Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 5
0
 def test_nis_bad_negative (self):
     _nis(atleast=-1)
Exemplo n.º 6
0
 def test_nis_no_spec (self):
     _nis()
Exemplo n.º 7
0
 def test_nis_bad_spec (self):
     _nis(atleast=1, exactly=2)