Skip to content

Commit

Permalink
Regard objects without any meta file as deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktor Dick committed Feb 5, 2024
1 parent b93690e commit cdecfd4
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions perfact/zodbsync/tests/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -1340,18 +1340,22 @@ def test_no_unnecessary_writes(self):
fsmtime2 = os.stat(path).st_mtime
assert fsmtime1 == fsmtime2

@pytest.mark.xfail
def test_no_meta_file(self):
"""
Check that a missing meta file is detected and we run into an error
TODO: Check how this should behave in the future with layers
Check that a missing meta file regards the object as deleted.
"""

broken_obj = os.path.join(self.repo.path, '__root__', 'foo')
os.mkdir(broken_obj)

with pytest.raises(AssertionError):
self.run('playback', '/foo')
self.run('playback', '/foo')
assert 'foo' not in self.app.objectIds()

self.add_folder('Test')
self.run('playback', '/Test')
os.remove(os.path.join(self.repo.path, '__root__/Test/__meta__'))
self.run('playback', '/Test')
assert 'Test' not in self.app.objectIds()

def test_force_default_owner(self):
"""
Expand Down

0 comments on commit cdecfd4

Please sign in to comment.