def test_bool(self): cmd = CommandListBase() self.assertFalse(bool(cmd)) cmd.append(Command()) self.assertTrue(bool(cmd))
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)
def test_len(self): cmd = CommandListBase() self.assertEqual(0, len(cmd)) cmd.append(Command()) self.assertEqual(1, len(cmd))
def test_append(self): cmd_list = CommandListBase() cmd = Command() cmd_list.append(cmd) self.assertEqual(cmd, cmd_list[0])