def test_cas_simple(tmpdir): """Test if a stored file can be retrieved.""" test_file_contents = 'go-backup is\na backup tool' test_cas = cas.CAS(tmpdir) # store the test file digest = hashing.hash_str(test_file_contents) test_file = StringIO.StringIO(test_file_contents) test_cas.store(test_file, digest) with test_cas.retrieve(digest) as retrieved_file: retrieved_contents = retrieved_file.read() assert test_file_contents == retrieved_contents assert test_cas.list() == [digest]
def test_hash_str_2(): assert hashing.hash_str(abc2) == abc2_digest
def test_hash_str_1(): assert hashing.hash_str(abc) == abc_digest
def test_hash_str(self): HASH = "cea6b92de1c15cfdbcf333982d340d3f" assert hash_str("test") == HASH