示例#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)
示例#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)
示例#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)
示例#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)
示例#5
0
 def test_nis_bad_negative (self):
     _nis(atleast=-1)
示例#6
0
 def test_nis_no_spec (self):
     _nis()
示例#7
0
 def test_nis_bad_spec (self):
     _nis(atleast=1, exactly=2)