MCPcopy
hub / github.com/beetbox/beets / test_revision

Method test_revision

test/test_dbcore.py:289–311  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

287 assert row["field_one"] == 123
288
289 def test_revision(self):
290 old_rev = self.db.revision
291 model = ModelFixture1()
292 model.add(self.db)
293 model.store()
294 assert model._revision == self.db.revision
295 assert self.db.revision > old_rev
296
297 mid_rev = self.db.revision
298 model2 = ModelFixture1()
299 model2.add(self.db)
300 model2.store()
301 assert model2._revision > mid_rev
302 assert self.db.revision > model._revision
303
304 # revision changed, so the model should be re-loaded
305 model.load()
306 assert model._revision == self.db.revision
307
308 # revision did not change, so no reload
309 mod2_old_rev = model2._revision
310 model2.load()
311 assert model2._revision == mod2_old_rev
312
313 def test_retrieve_by_id(self):
314 model = ModelFixture1()

Callers

nothing calls this directly

Calls 4

ModelFixture1Class · 0.85
addMethod · 0.45
storeMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected