Commit 3908c653 authored by Cadiot Matthieu's avatar Cadiot Matthieu
Browse files

test du test final

parent a77db167
......@@ -5,11 +5,11 @@ from binary import Binary
#define Test class as a derived class of the unittest.TestCase base class
class Test(unittest.TestCase):
def setUp(self):
self.binary = Binary(6)
self.binary = Binary(6)
def test_binary_init_int(self):
binary = Binary(6)
assert int(binary) == 6
binary = Binary(6)
assert int(binary) == 6
def test_binary_init_bitstr(self):
binary = Binary('101')
......@@ -17,23 +17,23 @@ class Test(unittest.TestCase):
def test_binary_init_binstr(self):
binary=bin(5)
assert int(binary)==5
binary=bin(5)
assert int(binary)==5
def test_binary_init_hexstr(self):
hexa=hex(5)
assert int(hexa)==5
def test_binary_init_hex(self):
hex='0x5'
assert int(hex)==5
hex='0x5'
assert int(hex)==5
def test_binary_init_intseq(self):
int_list=[1,2,3,4]
for elt in int_list
assert type(elt)==int
int_list=[1,2,3,4]
for elt in int_list
assert type(elt)==int
def test_binary_init_strseq(self):
int_list_str=['1','2','3','4']
for elt in int_list
assert type(elt)==str
int_list_str=['1','2','3','4']
for elt in int_list
assert type(elt)==str
......@@ -17,16 +17,23 @@ class Test(unittest.TestCase):
def test_binary_init_binstr(self):
binary=bin(5)
assert int(binary)==5
binary=bin(5)
assert int(binary)==5
def test_binary_init_hexstr(self):
hexa=hex(5)
assert int(hexa)==5
def test_binary_init_hex(self):
hex='0x5'
assert int(hex)==5
deftest_binary_init_intseq(self):
def test_binary_init_intseq(self):
int_list=[1,2,3,4]
for elt in int_list
assert type(elt)==int
def test_binary_init_strseq(self):
int_list_str=['1','2','3','4']
for elt in int_list
assert type(elt)==str
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment