예제 #1
0
 def test_bad_alphabet(self):
     with pytest.raises(ValueError):
         digits(3, 2, alphabet=[1, 2, 3])
예제 #2
0
 def test_bad_base(self):
     with pytest.raises(ValueError):
         digits(3, 1)
예제 #3
0
 def test_nonint_base(self):
     with pytest.raises(ValueError):
         digits(3, 3.2)
예제 #4
0
 def test_with_pad(self):
     x = digits(3, 2, pad=4, alphabet=[0, 1])
     assert x == [0, 0, 1, 1]
예제 #5
0
    def test_little_endian(self):
        x = digits(2, 2)
        assert x == [1, 0]

        x = digits(2, 2, big_endian=False)
        assert x == [0, 1]
예제 #6
0
파일: test_misc.py 프로젝트: chebee7i/dit
 def test_with_alphabet(self):
     x = digits(3, 2, alphabet=[0, 1])
     assert_equal(x, [1, 1])
예제 #7
0
 def test_with_alphabet(self):
     x = digits(3, 2, alphabet=[0, 1])
     assert x == [1, 1]
예제 #8
0
파일: test_misc.py 프로젝트: chebee7i/dit
 def test_with_pad(self):
     x = digits(3, 2, pad=4, alphabet=[0, 1])
     assert_equal(x, [0, 0, 1, 1])
예제 #9
0
파일: test_misc.py 프로젝트: chebee7i/dit
    def test_little_endian(self):
        x = digits(2, 2)
        assert_equal(x, [1, 0])

        x = digits(2, 2, big_endian=False)
        assert_equal(x, [0, 1])
예제 #10
0
파일: test_misc.py 프로젝트: gto00002/dit
 def test_with_alphabet(self):
     x = digits(3, 2, alphabet=[0, 1])
     assert_equal(x, [1, 1])
예제 #11
0
파일: test_misc.py 프로젝트: gto00002/dit
    def test_little_endian(self):
        x = digits(2, 2)
        assert_equal(x, [1, 0])

        x = digits(2, 2, big_endian=False)
        assert_equal(x, [0, 1])
예제 #12
0
    def test_little_endian(self):
        x = digits(2, 2)
        assert x == [1, 0]

        x = digits(2, 2, big_endian=False)
        assert x == [0, 1]
예제 #13
0
 def test_with_alphabet(self):
     x = digits(3, 2, alphabet=[0, 1])
     assert x == [1, 1]
예제 #14
0
 def test_bad_alphabet(self):
     with pytest.raises(ValueError):
         digits(3, 2, alphabet=[1,2,3])
예제 #15
0
 def test_nonint_base(self):
     with pytest.raises(ValueError):
         digits(3, 3.2)
예제 #16
0
 def test_bad_base(self):
     with pytest.raises(ValueError):
         digits(3, 1)