def test_createWithInstance(self): inst = TempClass() ter = Terminal(inst) self.assertEqual(inst, ter.symbol(), 'Terminal should return same instance') self.assertEqual(inst, ter.s, 'Terminal should return same instance') self.assertEqual(ter.symbol(), ter.s, 'Symbol and s property should have same value')
def test_createWithNumber(self): ter = Terminal(5) self.assertEqual(5, ter.symbol(), 'Terminal should return same number') self.assertEqual(5, ter.s, 'Terminal should return same number') self.assertEqual(ter.symbol(), ter.s, 'Symbol and s property should have same value')
def test_createWithClass(self): ter = Terminal(TempClass) self.assertEqual(TempClass, ter.symbol(), 'Terminal should return same class') self.assertEqual(TempClass, ter.s, 'Terminal should return same class') self.assertEqual(ter.symbol(), ter.s, 'Symbol and s property should have same value')
def test_createWithInstance(self): inst = TempClass() ter = Terminal(inst) self.assertEqual(inst, ter.symbol(), 'Terminal should return same instance')
def test_createWithSymbol(self): ter = Terminal('a') self.assertEqual('a', ter.symbol(), 'Terminal should return same symbol') self.assertEqual('a', ter.s, 'Terminal should return same symbol') self.assertEqual(ter.symbol(), ter.s, 'Symbol and s property should have same value')
def test_createWithClass(self): ter = Terminal(TempClass) self.assertEqual(TempClass, ter.symbol(), 'Terminal should return same class')
def test_createWithNumber(self): ter = Terminal(5) self.assertEqual(5, ter.symbol(), 'Terminal should return same number')
def test_createWithSymbol(self): ter = Terminal('a') self.assertEqual('a', ter.symbol(), 'Terminal should return same symbol')
def test_sameInstance(self): ter1 = Terminal(0) ter2 = Terminal(0) self.assertEqual(ter1, ter2)
def test_sameClass(self): ter1 = Terminal(0) ter2 = Terminal(0) self.assertEqual(ter1, ter2)