Exemple #1
0
    def test_bin_noarg(self):
        try:
            binary.bin()

        except TypeError:
            pass

        except:
            assert 0, 'bin() tolerates no arguments'
Exemple #2
0
    def test_bin_noarg(self):
        try:
            binary.bin()

        except TypeError:
            pass

        except:
            assert 0, 'bin() tolerates no arguments'
Exemple #3
0
 def test_bin_neg(self):
     assert '-0b1000000010000000100000001' == binary.bin(-0x01010101)
Exemple #4
0
 def test_bin_pos(self):
     assert '0b1000000010000000100000001' == binary.bin(0x01010101)
Exemple #5
0
 def test_bin_allzeros(self):
     assert '0b0' == binary.bin(0x0000000)
Exemple #6
0
 def test_bin_allones(self):
     assert '0b1111111111111111111111111111111111111111111111111111111111111111' == binary.bin(0xffffffffffffffff)
Exemple #7
0
 def test_bin_zero(self):
     assert '0b0' == binary.bin(0)
Exemple #8
0
 def test_bin_neg(self):
     assert '-0b1000000010000000100000001' == binary.bin(-0x01010101)
Exemple #9
0
 def test_bin_pos(self):
     assert '0b1000000010000000100000001' == binary.bin(0x01010101)
Exemple #10
0
 def test_bin_allzeros(self):
     assert '0b0' == binary.bin(0x0000000)
Exemple #11
0
 def test_bin_allones(self):
     assert '0b1111111111111111111111111111111111111111111111111111111111111111' == binary.bin(
         0xffffffffffffffff)
Exemple #12
0
 def test_bin_zero(self):
     assert '0b0' == binary.bin(0)