diff --git a/khmer/_khmer.cc b/khmer/_khmer.cc index f3f9d2a0e2..33c3a02cb0 100644 --- a/khmer/_khmer.cc +++ b/khmer/_khmer.cc @@ -262,7 +262,7 @@ khmer_Read_init(khmer_Read_Object *self, PyObject *args, PyObject *kwds) const_cast("quality"), const_cast("annotations"), NULL }; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "|zzzz", kwlist, + if (!PyArg_ParseTupleAndKeywords(args, kwds, "ss|zz", kwlist, &name, &sequence, &quality, &annotations)) { return 0; } diff --git a/tests/test_read_parsers.py b/tests/test_read_parsers.py index aa49a9c8b9..dbe3480c17 100644 --- a/tests/test_read_parsers.py +++ b/tests/test_read_parsers.py @@ -47,11 +47,16 @@ def test_read_type_basic(): # test that basic properties of khmer.Read behave like screed.Record - r = Read() - s = Record() - for attr in ('sequence', 'name', 'quality', 'annotations'): - assert not hasattr(r, attr), attr - assert not hasattr(s, attr), attr + name = "895:1:1:1246:14654 1:N:0:NNNNN" + sequence = "ACGT" + r = Read(name, sequence) + s = Record(dict(name=name, sequence=sequence)) + + for x in (r, s): + assert x.name == name + assert x.sequence == sequence + assert not hasattr(x, 'quality'), x + assert not hasattr(x, 'annotations'), x def test_read_type_attributes():