def test_in_memory(): # Write contents storage = MemoryStorage() storage.write(element) # Verify contents assert_equal(element, storage.read())
def __init__(self, path: PathType, **kwargs): """Create a new instance :param str path: Path to file""" if (not globals().get("auto_convert_to_pathlib", False) or locals().get("auto_convert_to_pathlib", False)): from . import auto_convert_to_pathlib current_path = auto_convert_to_pathlib(path) self.path = current_path MemoryStorage.__init__(self) JSONStorage.__init__(self, current_path, **kwargs)
def test_in_memory(): # Write contents storage = MemoryStorage() storage.write(element) # Verify contents assert element == storage.read() # Test case for #21 other = MemoryStorage() other.write({}) assert other.read() != storage.read()
def test_in_memory(): # Write contents storage = MemoryStorage() storage.write(doc) # Verify contents assert doc == storage.read() # Test case for #21 other = MemoryStorage() other.write({}) assert other.read() != storage.read()