ii-vision/transcoder/opcodes_test.py
2019-03-21 16:42:47 +00:00

29 lines
618 B
Python

"""Tests for the opcodes module."""
import unittest
import opcodes
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()