Пример #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
 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
 def test_with_pad(self):
     x = digits(3, 2, pad=4, alphabet=[0, 1])
     assert_equal(x, [0, 0, 1, 1])
Пример #9
0
    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
 def test_with_alphabet(self):
     x = digits(3, 2, alphabet=[0, 1])
     assert_equal(x, [1, 1])
Пример #11
0
    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)