Example #1
0
    def test_should_verify_argument_when_argument_matches_given_pattern(self):
        command_input = CommandInput('command', ['arg1'], 'stdin')
        wrapper = CommandInputVerifier(command_input)

        actual_value = wrapper.at_least_one_argument_matches('^arg')

        self.assertEqual(wrapper, actual_value)
Example #2
0
    def test_should_verify_more_complex_pattern_given(self):
        command_input = CommandInput(
            'command', ['arg1', 'borg', 'spam', '123abc'], 'stdin')
        wrapper = CommandInputVerifier(command_input)

        actual_value = wrapper.at_least_one_argument_matches('\d{3}[a-c]{3}')

        self.assertEqual(wrapper, actual_value)