Example #1
0
 def test_successful_parse(self, arg_list: List[str],
                           expected_output: Mapping[str, Any],
                           destination: Destination):
     parsed_args = vars(destination.parse_args(arg_list))
     assert (
         parsed_args == expected_output
     ), f"Expected parsing {arg_list} to return parsed args {expected_output} but instead found {parsed_args}"
Example #2
0
 def test_failed_parse(self, arg_list: List[str], destination: Destination):
     # We use BaseException because it encompasses SystemExit (raised by failed parsing) and other exceptions (raised by additional semantic
     # checks)
     with pytest.raises(BaseException):
         destination.parse_args(arg_list)