Example #1
0
 def testMigratesAllArtifactsWithReadFromRelDB(self, unused_data_store):
     self.assertEmpty(data_store.REL_DB.ReadAllArtifacts())
     _SetUpArtifacts()
     self.assertEmpty(data_store.REL_DB.ReadAllArtifacts())
     migration.MigrateArtifacts()
     self.assertLen(data_store.REL_DB.ReadAllArtifacts(), 29)
Example #2
0
 def testMigrationWithOverwriteDoesNotThrow(self):
     _SetUpArtifacts()
     migration.MigrateArtifacts()
     migration.MigrateArtifacts(overwrite=True)
     self.assertLen(data_store.REL_DB.ReadAllArtifacts(), 29)
Example #3
0
 def testDeletesExistingArtifactsInRelDB(self):
     data_store.REL_DB.WriteArtifact(rdf_artifacts.Artifact(name="old"))
     self.assertLen(data_store.REL_DB.ReadAllArtifacts(), 1)
     migration.MigrateArtifacts()
     self.assertEmpty(data_store.REL_DB.ReadAllArtifacts())