def it_marks_files_as_modified(instance): instance.__mapper__.create() instance.__mapper__.modified = False utilities.save(instance) expect(instance.__mapper__.modified) == True
def it_requires_a_mapped_instance(): with expect.raises(TypeError): utilities.save(Mock)
def it_expects_the_file_to_not_be_deleted(instance): instance.__mapper__.delete() with expect.raises(exceptions.DeletedFileError): utilities.save(instance)
def it_creates_files(instance): utilities.save(instance) expect(instance.__mapper__.exists) == True
def save(self): return utilities.save(self)