Skip to content

Commit

Permalink
Coverage for missing lines
Browse files Browse the repository at this point in the history
  • Loading branch information
luizirber committed Feb 25, 2015
1 parent 2db412b commit 760b071
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 0 additions & 3 deletions khmer/_khmermodule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4491,9 +4491,6 @@ hllcounter_set_ksize(khmer_KHLLCounter_Object * me, PyObject *value,

try {
me->hllcounter->set_ksize(ksize);
} catch (InvalidValue &e) {
PyErr_SetString(PyExc_ValueError, e.what());
return -1;
} catch (ReadOnlyAttribute &e) {
PyErr_SetString(PyExc_AttributeError, e.what());
return -1;
Expand Down
8 changes: 7 additions & 1 deletion tests/test_hll.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ def test_hll_change_error_rate():
with assert_raises(ValueError):
hllcpp.error_rate = 2.5

with assert_raises(ValueError):
hllcpp.error_rate = -10.

# error rate can only be changed prior to first counting,
hllcpp.consume_string('AAACCACTTGTGCATGTCAGTGCAGTCAGT')
with assert_raises(AttributeError):
Expand All @@ -219,7 +222,10 @@ def test_hll_change_ksize():
hllcpp = khmer.HLLCounter(0.0040625, K)
assert hllcpp.ksize == K

hllcpp.ksize = 12
hllcpp.ksize = 24
assert hllcpp.ksize == 24

hllcpp.ksize = 12L
assert hllcpp.ksize == 12

with assert_raises(ValueError):
Expand Down

0 comments on commit 760b071

Please sign in to comment.