示例#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)