Example #1
0
    def test_nis_atmost (self):
        assert _nis(atmost=0)(0)
        assert _nis(atmost=1)(0)
        assert _nis(atmost=1)(1)

        assert not _nis(atmost=0)(1)
        assert not _nis(atmost=1)(2)
Example #2
0
    def test_nis_atleast (self):
        assert _nis(atleast=0)(0)
        assert _nis(atleast=0)(1)
        assert _nis(atleast=2)(2)

        assert not _nis(atleast=1)(0)
        assert not _nis(atleast=2)(1)
Example #3
0
    def test_nis_between (self):
        assert _nis(atleast=0, atmost=1)(0)
        assert _nis(atleast=0, atmost=1)(1)
        assert _nis(atleast=1, atmost=2)(1)
        assert _nis(atleast=1, atmost=2)(2)
        assert _nis(atleast=1, atmost=3)(2)
        assert _nis(atleast=2, atmost=3)(2)
        assert _nis(atleast=2, atmost=3)(3)

        assert not _nis(atleast=1, atmost=2)(0)
        assert not _nis(atleast=1, atmost=2)(3)
Example #4
0
    def test_nis_exactly (self):
        assert _nis(exactly=0)(0)
        assert _nis(exactly=1)(1)
        assert _nis(exactly=2)(2)

        assert not _nis(exactly=0)(1)
        assert not _nis(exactly=1)(2)
        assert not _nis(exactly=2)(1)
Example #5
0
 def test_nis_bad_negative (self):
     _nis(atleast=-1)
Example #6
0
 def test_nis_no_spec (self):
     _nis()
Example #7
0
 def test_nis_bad_spec (self):
     _nis(atleast=1, exactly=2)