예제 #1
0
 def test_scripts_to_run_with_no_upgrades(self):
     """No upgrades are available."""
     artefact = "openquake/pshai"
     rev_info = {"step": "2", "id": "3", "revision": "0.3.9-1"}
     config = {"dryrun": True, "path": self.path, "host": "localhost",
               "db": "openquake", "user": "******"}
     touch("%s/01-a.sql" % self.path1)
     touch("%s/01-a.sql" % self.path2)
     self.assertEqual([], scripts_to_run(artefact, rev_info, config))
예제 #2
0
 def test_scripts_to_run_with_no_upgrades(self):
     """No upgrades are available."""
     artefact = "openquake/pshai"
     rev_info = {"step": "2", "id": "3", "revision": "0.3.9-1"}
     config = {
         "dryrun": True,
         "path": self.path,
         "host": "localhost",
         "db": "openquake",
         "user": "******"
     }
     touch("%s/01-a.sql" % self.path1)
     touch("%s/01-a.sql" % self.path2)
     self.assertEqual([], scripts_to_run(artefact, rev_info, config))
예제 #3
0
 def test_scripts_to_run_with_available_upgrades(self):
     """Upgrades are available."""
     artefact = "openquake/hzrdi"
     rev_info = {"step": "2", "id": "3", "revision": "0.3.9-1"}
     config = {"dryrun": True, "path": self.path, "host": "localhost",
               "db": "openquake", "user": "******"}
     touch("%s/01-a.sql" % self.path_38_1)
     touch("%s/01-a.sql" % self.path_39_1)
     touch("%s/01-a.sql" % self.path_38_5)
     touch("%s/01-b.sql" % self.path_39_2)
     touch("%s/01-c.sql" % self.path_39_3)
     touch("%s/02-d.sql" % self.path_39_3)
     touch("%s/01-a.sql" % self.path_42_1)
     touch("%s/02-b.sql" % self.path_42_1)
     self.assertEqual(["0.3.9-1/3/01-c.sql", "0.3.9-1/3/02-d.sql",
                       "0.4.2/1/01-a.sql", "0.4.2/1/02-b.sql"],
                      scripts_to_run(artefact, rev_info, config))
예제 #4
0
 def test_scripts_to_run_with_available_upgrades(self):
     """Upgrades are available."""
     artefact = "openquake/hzrdi"
     rev_info = {"step": "2", "id": "3", "revision": "0.3.9-1"}
     config = {
         "dryrun": True,
         "path": self.path,
         "host": "localhost",
         "db": "openquake",
         "user": "******"
     }
     touch("%s/01-a.sql" % self.path_38_1)
     touch("%s/01-a.sql" % self.path_39_1)
     touch("%s/01-a.sql" % self.path_38_5)
     touch("%s/01-b.sql" % self.path_39_2)
     touch("%s/01-c.sql" % self.path_39_3)
     touch("%s/02-d.sql" % self.path_39_3)
     touch("%s/01-a.sql" % self.path_42_1)
     touch("%s/02-b.sql" % self.path_42_1)
     self.assertEqual([
         "0.3.9-1/3/01-c.sql", "0.3.9-1/3/02-d.sql", "0.4.2/1/01-a.sql",
         "0.4.2/1/02-b.sql"
     ], scripts_to_run(artefact, rev_info, config))