Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_compute_checksum(tmp_path):
tmpfile = tmp_path.joinpath("fname")
fname = str(tmpfile)
tmpfile.write_text("spam and eggs")
md5 = johnnydep.pipper.compute_checksum(fname, algorithm="md5")
sha256 = johnnydep.pipper.compute_checksum(fname)
assert md5 == "b581660cff17e78c84c3a84ad02e6785"
assert sha256 == "7c788633adc75d113974372eec8c24776a581f095a747136e7ccf41b4a18b74e"
def test_compute_checksum(tmp_path):
tmpfile = tmp_path.joinpath("fname")
fname = str(tmpfile)
tmpfile.write_text("spam and eggs")
md5 = johnnydep.pipper.compute_checksum(fname, algorithm="md5")
sha256 = johnnydep.pipper.compute_checksum(fname)
assert md5 == "b581660cff17e78c84c3a84ad02e6785"
assert sha256 == "7c788633adc75d113974372eec8c24776a581f095a747136e7ccf41b4a18b74e"