2019-03-21 16:42:47 +00:00
|
|
|
"""Tests for the opcodes module."""
|
|
|
|
|
2019-02-23 23:38:14 +00:00
|
|
|
import unittest
|
|
|
|
|
2019-03-21 16:24:40 +00:00
|
|
|
import opcodes
|
2019-02-23 23:38:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
class TestOpcodes(unittest.TestCase):
|
|
|
|
def test_equality(self):
|
|
|
|
op1 = opcodes.Terminate()
|
|
|
|
op2 = opcodes.Terminate()
|
|
|
|
self.assertEqual(op1, op2)
|
|
|
|
|
|
|
|
op1 = opcodes.SetPage(0x20)
|
|
|
|
op2 = opcodes.SetPage(0x20)
|
|
|
|
self.assertEqual(op1, op2)
|
|
|
|
|
|
|
|
op1 = opcodes.SetPage(0x20)
|
|
|
|
op2 = opcodes.SetPage(0x21)
|
|
|
|
self.assertNotEqual(op1, op2)
|
|
|
|
|
|
|
|
op1 = opcodes.SetPage(0x20)
|
|
|
|
op2 = opcodes.Terminate()
|
|
|
|
self.assertNotEqual(op1, op2)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest.main()
|