Skip to content

Commit

Permalink
Mandatory arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
betatim committed Oct 31, 2016
1 parent 4ab32de commit dd795bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion khmer/_khmer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ khmer_Read_init(khmer_Read_Object *self, PyObject *args, PyObject *kwds)
const_cast<char *>("quality"), const_cast<char *>("annotations"), NULL
};

if (!PyArg_ParseTupleAndKeywords(args, kwds, "|zzzz", kwlist,
if (!PyArg_ParseTupleAndKeywords(args, kwds, "ss|zz", kwlist,
&name, &sequence, &quality, &annotations)) {
return 0;
}
Expand Down
15 changes: 10 additions & 5 deletions tests/test_read_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit dd795bc

Please sign in to comment.