Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self):
self.load(get_adjacent_file('reporters.json'))
self.add_fallback_reporter_config(["PythonNative", "python", [get_adjacent_file("python_native_reporter.py")]])
def test_verify_file(self):
name = "testFile.txt"
filename = get_adjacent_file(name)
verify_file(filename, self.reporter)
def __init__(self):
self.load(get_adjacent_file('reporters.json'))
self.add_fallback_reporter_config(["PythonNative", "python", [get_adjacent_file("python_native_reporter.py")]])
def test_assert_against_file_works(self):
file_path = get_adjacent_file("manual_file.approved.txt")
assert_against_file("This text is in a file", file_path)
def test_assert_against_file_fails_with_reporter(self):
reporter = ReporterForTesting()
file_path = get_adjacent_file("manual_file.approved.txt")
try:
assert_against_file("This text is NOT in a file", file_path, reporter )
except ApprovalException:
pass
self.assertTrue(reporter.called)