def test_parseStore(self): line = "123 -> a" cmd = dec07.parse(line) self.assertIsInstance(cmd, dec07.StoreCommand) g = defaultdict(int) cmd.run(g) self.assertEquals(123, g['a'])
def test_parseOr(self): line = 'a OR b -> c' cmd = dec07.parse(line) self.assertIsInstance(cmd, dec07.OrCommand) g = defaultdict(int) g['a'] = 1 g['b'] = 2 cmd.run(g) self.assertEquals(3, g['c'])