mirror of
https://github.com/robmcmullen/atrcopy.git
synced 2024-10-31 23:09:28 +00:00
Added test_utils.py
This commit is contained in:
parent
5fcb646131
commit
1e38dfb516
23
test/test_utils.py
Normal file
23
test/test_utils.py
Normal file
@ -0,0 +1,23 @@
|
||||
from mock import *
|
||||
from atrcopy import utils
|
||||
|
||||
|
||||
class TestTextToInt(object):
|
||||
def setup(self):
|
||||
pass
|
||||
|
||||
@pytest.mark.parametrize("text,expected,default_base", [
|
||||
("12", 0x12, "hex"),
|
||||
("$1234", 0x1234, "hex"),
|
||||
("0xffff", 0xffff, "hex"),
|
||||
("#12", 12, "hex"),
|
||||
("%11001010", 202, "hex"),
|
||||
|
||||
("12", 12, "dec"),
|
||||
("$1234", 0x1234, "dec"),
|
||||
("0xffff", 0xffff, "dec"),
|
||||
("#12", 12, "dec"),
|
||||
("%11001010", 202, "dec"),
|
||||
])
|
||||
def test_text_to_int(self, text, expected, default_base):
|
||||
assert expected == utils.text_to_int(text, default_base)
|
Loading…
Reference in New Issue
Block a user