예제 #1
0
 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')
예제 #2
0
 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')
예제 #3
0
 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')
예제 #4
0
 def test_createWithInstance(self):
     inst = TempClass()
     ter = Terminal(inst)
     self.assertEqual(inst, ter.symbol(), 'Terminal should return same instance')
예제 #5
0
 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')
예제 #6
0
 def test_createWithClass(self):
     ter = Terminal(TempClass)
     self.assertEqual(TempClass, ter.symbol(), 'Terminal should return same class')
예제 #7
0
 def test_createWithNumber(self):
     ter = Terminal(5)
     self.assertEqual(5, ter.symbol(), 'Terminal should return same number')
예제 #8
0
 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)