in cassette/cassette_library.py [0:0]
def write_to_file(self):
"""Write mocked responses to file."""
# Serialize the items via YAML
data = {k: v.to_dict() for k, v in self.data.items()}
encoded_str = self.encoder.dump(data)
# Save the changes to file
with open(self.filename, "w+") as f:
f.write(encoded_str)
# Update our hash
self.save_to_cache(file_hash=_hash(encoded_str), data=self.data)
self.is_dirty = False