def test_non_working_reporter_does_not_report(self) -> None:
        self.assertFileDoesNotExist(self.approved_file_path)

        reporter = GenericDiffReporter(create_config(["Custom", "NotReal"]))
        success = reporter.report(self.received_file_path, self.approved_file_path)

        self.assertFalse(success)
Пример #2
0
def test_pycharm_diff_command() -> None:
    reporter = GenericDiffReporter(
        create_config([
            "PyCharm", "/Applications/PyCharm CE.app/Contents/MacOS/pycharm",
            ["diff"]
        ]))
    received_path = "received.txt"
    approved_path = "approved.txt"
    verify(str(reporter.get_command(received_path, approved_path)))
 def _test_string_representation(self) -> None:
     reporter = GenericDiffReporter(create_config(["Custom", "NotReal"]))
     expected = "GenericDiffReporter(...)"
     self.assertEqual(expected, str(reporter))
 def test_notworking_in_environment(self) -> None:
     reporter = GenericDiffReporter(create_config(["Custom", "NotReal"]))
     self.assertFalse(reporter.is_working())
Пример #5
0
 def load(self, file_name: str) -> List[GenericDiffReporterConfig]:
     with open(file_name, "r", encoding='utf8') as file:
         configs = json.load(file)
     self.reporters = [create_config(config) for config in configs]
     return self.reporters
Пример #6
0
 def add_default_reporter_config(self, config):
     self.reporters.insert(0, create_config(config))
Пример #7
0
 def create(diff_tool_path: str) -> "GenericDiffReporter":
     return GenericDiffReporter(create_config(["custom", diff_tool_path]))