コード例 #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
ファイル: test_misc.py プロジェクト: Autoplectic/dit
    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
ファイル: test_misc.py プロジェクト: Autoplectic/dit
 def test_with_alphabet(self):
     x = digits(3, 2, alphabet=[0, 1])
     assert x == [1, 1]
コード例 #14
0
ファイル: test_misc.py プロジェクト: Autoplectic/dit
 def test_bad_alphabet(self):
     with pytest.raises(ValueError):
         digits(3, 2, alphabet=[1,2,3])
コード例 #15
0
ファイル: test_misc.py プロジェクト: Autoplectic/dit
 def test_nonint_base(self):
     with pytest.raises(ValueError):
         digits(3, 3.2)
コード例 #16
0
ファイル: test_misc.py プロジェクト: Autoplectic/dit
 def test_bad_base(self):
     with pytest.raises(ValueError):
         digits(3, 1)