Beispiel #1
0
 def test_bool(self):
     cmd = CommandListBase()
     self.assertFalse(bool(cmd))
     cmd.append(Command())
     self.assertTrue(bool(cmd))
Beispiel #2
0
 def test_extend(self):
     cmd_list = CommandListBase()
     cmds = [Command() for i in xrange(3)]
     cmd_list.extend(cmds)
     for cmd, cmd_on_list in izip(cmds, cmd_list):
         self.assertEqual(cmd, cmd_on_list)
Beispiel #3
0
 def test_len(self):
     cmd = CommandListBase()
     self.assertEqual(0, len(cmd))
     cmd.append(Command())
     self.assertEqual(1, len(cmd))
Beispiel #4
0
 def test_append(self):
     cmd_list = CommandListBase()
     cmd = Command()
     cmd_list.append(cmd)
     self.assertEqual(cmd, cmd_list[0])