Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Roucan Sofia
my-awesome-project
Commits
723ec88a
Commit
723ec88a
authored
Mar 28, 2017
by
Cadiot Matthieu
Browse files
test du test finalee
parent
3908c653
Changes
2
Hide whitespace changes
Inline
Side-by-side
test.md
View file @
723ec88a
...
...
@@ -17,12 +17,12 @@ class Test(unittest.TestCase):
def test_binary_init_binstr(self):
binary=
bin(5)
assert int(binary)==
5
binary=
'0b110'
assert int(binary)==
6
def test_binary_init_hexstr(self):
hexa=
hex(5)
assert int(hexa)==
5
hexa=
0x6
assert int(hexa)==
6
def test_binary_init_hex(self):
hex='0x5'
...
...
test.md~
View file @
723ec88a
...
...
@@ -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=
'0b110'
assert int(binary)==
6
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment