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)
def testMigrationWithOverwriteDoesNotThrow(self): _SetUpArtifacts() migration.MigrateArtifacts() migration.MigrateArtifacts(overwrite=True) self.assertLen(data_store.REL_DB.ReadAllArtifacts(), 29)
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())