mirror of
https://github.com/mnaberez/py65.git
synced 2025-02-08 16:30:35 +00:00
Fixed deprecation warnings on Python 2.6.
This commit is contained in:
parent
019a755315
commit
8d50164ecf
@ -1,3 +1,7 @@
|
||||
* Next Release *
|
||||
|
||||
- Fixed deprecation warnings on Python 2.6
|
||||
|
||||
0.7 (2009-09-03)
|
||||
|
||||
- When using the monitor, the nonblocking character input at
|
||||
|
@ -27,55 +27,55 @@ class HexdumpLoaderTests(unittest.TestCase):
|
||||
try:
|
||||
Loader(text)
|
||||
self.fail()
|
||||
except ValueError, e:
|
||||
except ValueError, why:
|
||||
msg = 'Start address was not found in data'
|
||||
self.assert_(e.message.startswith('Start address'))
|
||||
self.assert_(why[0].startswith('Start address'))
|
||||
|
||||
def test_raises_when_start_address_is_invalid(self):
|
||||
text = 'oops: aa bb cc'
|
||||
try:
|
||||
Loader(text)
|
||||
self.fail()
|
||||
except ValueError, e:
|
||||
except ValueError, why:
|
||||
msg = 'Could not parse address: oops'
|
||||
self.assertEqual(msg, e.message)
|
||||
self.assertEqual(msg, why[0])
|
||||
|
||||
def test_raises_when_start_address_is_too_short(self):
|
||||
text = '01: aa bb cc'
|
||||
try:
|
||||
Loader(text)
|
||||
self.fail()
|
||||
except ValueError, e:
|
||||
except ValueError, why:
|
||||
msg = 'Expected address to be 2 bytes, got 1'
|
||||
self.assertEqual(msg, e.message)
|
||||
self.assertEqual(msg, why[0])
|
||||
|
||||
def test_raises_when_start_address_is_too_long(self):
|
||||
text = '010304: aa bb cc'
|
||||
try:
|
||||
Loader(text)
|
||||
self.fail()
|
||||
except ValueError, e:
|
||||
except ValueError, why:
|
||||
msg = 'Expected address to be 2 bytes, got 3'
|
||||
self.assertEqual(msg, e.message)
|
||||
self.assertEqual(msg, why[0])
|
||||
|
||||
def test_raises_when_next_address_is_unexpected(self):
|
||||
text = "c000: aa\nc002: cc"
|
||||
try:
|
||||
Loader(text)
|
||||
self.fail()
|
||||
except ValueError, e:
|
||||
except ValueError, why:
|
||||
msg = 'Non-contigous block detected. Expected next ' \
|
||||
'address to be $c001, label was $c002'
|
||||
self.assertEqual(msg, e.message)
|
||||
self.assertEqual(msg, why[0])
|
||||
|
||||
def test_raises_when_data_is_invalid(self):
|
||||
text = 'c000: foo'
|
||||
try:
|
||||
Loader(text)
|
||||
self.fail()
|
||||
except ValueError, e:
|
||||
except ValueError, why:
|
||||
msg = 'Could not parse data: foo'
|
||||
self.assertEqual(msg, e.message)
|
||||
self.assertEqual(msg, why[0])
|
||||
|
||||
def test_loads_data_without_dollar_signs(self):
|
||||
text = 'c000: aa bb'
|
||||
|
Loading…
x
Reference in New Issue
Block a user