コード例 #1
0
    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():
    reporter = GenericDiffReporter([
        "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)))
コード例 #3
0
    def test_non_working_reporter_does_not_report(self):
        self.assertFileDoesNotExist(self.approved_file_path)

        reporter = GenericDiffReporter(('Custom', 'NotReal'))
        success = reporter.report(self.received_file_path,
                                  self.approved_file_path)

        self.assertFalse(success)
コード例 #4
0
 def test_simple(self):
     verify(
         "Hello",
         options=Options().with_reporter(
             GenericDiffReporter.create(
                 r"C:\my\favorite\diff\utility.exe")),
     )
コード例 #5
0
 def _test_string_representation(self) -> None:
     reporter = GenericDiffReporter(create_config(["Custom", "NotReal"]))
     expected = "GenericDiffReporter(...)"
     self.assertEqual(expected, str(reporter))
コード例 #6
0
 def instantiate_reporter_for_test() -> GenericDiffReporter:
     program = r"C:\Windows\System32\help.exe" if is_windows_os() else "echo"
     reporter = GenericDiffReporter.create(program)
     setattr(reporter, "run_command", lambda command_array: None)
     return reporter
コード例 #7
0
 def test_notworking_in_environment(self) -> None:
     reporter = GenericDiffReporter(create_config(["Custom", "NotReal"]))
     self.assertFalse(reporter.is_working())
コード例 #8
0
 def _create_reporter(
         config: GenericDiffReporterConfig) -> GenericDiffReporter:
     return GenericDiffReporter(config)
コード例 #9
0
 def setUp(self):
     reporter = MultiReporter(GenericDiffReporter.create('diff'),
                              CommandLineReporter())
     approvals.set_default_reporter(reporter)
コード例 #10
0
ファイル: pam.py プロジェクト: objarni/pam
def verify(fn, args):
    verify_all_combinations(fn,
                            args,
                            reporter=GenericDiffReporter(('meld', 'meld')))
コード例 #11
0
 def instantiate_reporter_for_test():
     reporter = GenericDiffReporter.create('echo')
     reporter.run_command = lambda command_array: None
     return reporter
コード例 #12
0
 def test_notworking_in_environment(self):
     reporter = GenericDiffReporter(('Custom', 'NotReal'))
     self.assertFalse(reporter.is_working())
コード例 #13
0
 def setUp(self):
     self.reporter = GenericDiffReporter(
         ("Tortoise", "C:/Program Files/TortoiseSVN/bin/tortoisemerge.exe"))
コード例 #14
0
 def setUp(self) -> None:
     reporter = MultiReporter(GenericDiffReporter.create("diff"),
                              CommandLineReporter())
コード例 #15
0
 def get(self, reporter_name):
     config = next((r for r in self.reporters if r[0] == reporter_name),
                   None)
     if not config:
         return None
     return GenericDiffReporter(config)
コード例 #16
0
 def _create_reporter(config):
     if not config:
         return None
     return GenericDiffReporter(config)
コード例 #17
0
 def get_all_reporters(self):
     instances = (GenericDiffReporter(r) for r in self.reporters)
     return instances
コード例 #18
0
 def instantiate_reporter_for_test():
     program = r'C:\Windows\System32\help.exe' if is_windows_os(
     ) else 'echo'
     reporter = GenericDiffReporter.create(program)
     reporter.run_command = lambda command_array: None
     return reporter