mirror of
https://github.com/mnaberez/py65.git
synced 2024-11-19 06:31:08 +00:00
Added tests for AddressParser.label_for().
This commit is contained in:
parent
6bcfe9233f
commit
d43cda43b5
@ -91,6 +91,17 @@ class AddressParserTests(unittest.TestCase):
|
||||
except KeyError, why:
|
||||
self.assertEqual('Label not found: bad_label', why[0])
|
||||
|
||||
def test_label_for_returns_label(self):
|
||||
parser = util.AddressParser(labels={'chrout':0xFFD2})
|
||||
self.assertEqual('chrout', parser.label_for(0xFFD2))
|
||||
|
||||
def test_label_for_returns_none_by_default(self):
|
||||
parser = util.AddressParser(labels={})
|
||||
self.assertEqual(None, parser.label_for(0xFFD2))
|
||||
|
||||
def test_label_for_returns_alternate_default(self):
|
||||
parser = util.AddressParser(labels={})
|
||||
self.assertEqual('foo', parser.label_for(0xFFD2, 'foo'))
|
||||
|
||||
def test_suite():
|
||||
return unittest.findTestCases(sys.modules[__name__])
|
||||
|
Loading…
Reference in New Issue
Block a user