def test_BugTaskCommandGroup_add(self): # BugEmailCommands can be added to the group. command_1 = BugEmailCommands.get('affects', ['fnord']) command_2 = BugEmailCommands.get('status', ['triaged']) group = BugTaskCommandGroup() group.add(command_1) group.add(command_2) self.assertEqual([command_1, command_2], group._commands)
def test_BugTaskCommandGroup_add(self): # BugEmailCommands can be added to the group. command_1 = BugEmailCommands.get('affects', ['fnord']) command_2 = BugEmailCommands.get('status', ['triaged']) group = BugTaskCommandGroup() group.add(command_1) group.add(command_2) self.assertEqual([command_1, command_2], group._commands)
def test_BugTaskCommandGroup__str__(self): # The str of a BugTaskCommandGroup is the ideal order of the # text commands in the email. command_1 = BugEmailCommands.get('affects', ['fnord']) command_2 = BugEmailCommands.get('status', ['triaged']) group = BugTaskCommandGroup() group.add(command_1) group.add(command_2) self.assertEqual('affects fnord\nstatus triaged', str(group))
def test_BugTaskCommandGroup__str__(self): # The str of a BugTaskCommandGroup is the ideal order of the # text commands in the email. command_1 = BugEmailCommands.get('affects', ['fnord']) command_2 = BugEmailCommands.get('status', ['triaged']) group = BugTaskCommandGroup() group.add(command_1) group.add(command_2) self.assertEqual( 'affects fnord\nstatus triaged', str(group))
def test_BugTaskCommandGroup_sorted_commands(self): # Commands are sorted by the Command's Rank. command_3 = BugEmailCommands.get('importance', ['low']) command_2 = BugEmailCommands.get('status', ['triaged']) command_1 = BugEmailCommands.get('affects', ['fnord']) group = BugTaskCommandGroup() group.add(command_3) group.add(command_2) group.add(command_1) self.assertEqual(0, command_1.RANK) self.assertEqual(4, command_2.RANK) self.assertEqual(5, command_3.RANK) self.assertEqual([command_1, command_2, command_3], group.commands)
def test_BugTaskCommandGroup_sorted_commands(self): # Commands are sorted by the Command's Rank. command_3 = BugEmailCommands.get('importance', ['low']) command_2 = BugEmailCommands.get('status', ['triaged']) command_1 = BugEmailCommands.get('affects', ['fnord']) group = BugTaskCommandGroup() group.add(command_3) group.add(command_2) group.add(command_1) self.assertEqual(0, command_1.RANK) self.assertEqual(4, command_2.RANK) self.assertEqual(5, command_3.RANK) self.assertEqual( [command_1, command_2, command_3], group.commands)