def test_should_return_true_if_other_has_equal_arguments(self): command_input1 = CommandInput( 'any_command', ['any_arg1', 'any_arg2'], 'any_stdin') command_input2 = CommandInput( 'any_command', ['any_arg2', 'any_arg1'], 'any_stdin') self.assertTrue(command_input1.fulfills(command_input2))
def test_should_return_false_if_other_has_at_least_one_different_argument(self): command_input1 = CommandInput( 'any_command', ['any_arg1', 'any_arg2'], 'any_stdin') command_input2 = CommandInput( 'any_command', ['any_arg1', 'any_arg2', 'other_argument'], 'any_stdin') self.assertFalse(command_input1.fulfills(command_input2))
def test_should_return_true_when_other_equal_command_and_arguments(self): command_input1 = CommandInput( 'any_command', ['any_arg1', 'any_arg2'], 'any_stdin') command_input2 = CommandInput( 'any_command', ['any_arg2', 'any_arg1'], 'any_stdin') self.assertTrue(command_input1.fulfills( command_input2), 'comparison: command')
def test_should_return_false_when_other_has_different_stdin(self): command_input1 = CommandInput( 'any_command', ['any_arg1', 'any_arg2'], 'any_stdin') command_input2 = CommandInput( 'any_command', ['any_arg1', 'any_arg2'], 'other_stdin') self.assertFalse( command_input1.fulfills(command_input2), 'comparison: stdin')
def test_should_return_true_when_stdin_is_none(self): command_input1 = CommandInput('any_command', ['argument'], 'any_stdin') command_input2 = CommandInput('any_command', ['argument'], None) self.assertTrue(command_input1.fulfills(command_input2))
def test_should_return_true_if_other_has_exactly_one_matching_argument_and_no_others(self): command_input1 = CommandInput( 'any_command', ['any_arg1', 'any_arg2'], 'any_stdin') command_input2 = CommandInput('any_command', ['any_arg1'], 'any_stdin') self.assertTrue(command_input1.fulfills(command_input2))