1
0
mirror of https://github.com/mnaberez/py65.git synced 2024-06-06 20:29:34 +00:00

Fixed deprecation warnings on Python 2.6.

This commit is contained in:
Mike Naberezny 2009-10-13 20:27:47 -07:00
parent 019a755315
commit 8d50164ecf
2 changed files with 16 additions and 12 deletions

View File

@ -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

View File

@ -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'