def test_string_diff_output(): cmp1 = open("tests/resources/util-diff/orig", "r").read() with tmpdir() as tmp: f = "%s/%s" % (tmp, "diff.str") fd = open(f, "w") assert not diff_against_string("tests/resources/util-diff/newf", cmp1, output_fd=fd) fd.close() cp1 = open(f, "r").read() cp2 = open("tests/resources/util-diff/diff.str", "r").read() assert cp1 == cp2
def test_string_diff_ret(): null = open("/dev/null", "w") assert not diff_against_string("tests/resources/util-diff/newf", "tests/resources/util-diff/orig", output_fd=null)