Exemple #1
0
 def test__sanity_ok(self, cnx, target):
     """
     Test :py:meth:`.VerticaMigrator._sanity_checks`.
     No exception should be raised if IP are different.
     """
     target.execute.return_value.fetchone.return_value = [0]
     VerticaMigrator('SourceDSN', 'TargetDSN', False)
Exemple #2
0
 def test__sanity_not_empty_but_thats_ok(self, cnx, target):
     """
     Test :py:meth:`.VerticaMigrator._sanity_checks`.
     No exception if target DB is not empty and we know it:
      even_not_empty=True.
     """
     target.execute.return_value.fetchone.return_value = [42]
     VerticaMigrator('SourceDSN', 'TargetDSN', False, even_not_empty=True)
Exemple #3
0
 def test__sanity_same_ip_diff_db(self, cnx, target, source):
     """
     Test :py:meth:`.VerticaMigrator._sanity_checks`.
     No exception should be raised if IPs are identical but
     DBs are different.
     """
     target.execute.return_value.fetchone.side_effect = [['targetDB'], [0]]
     source.execute.return_value.fetchone.return_value = ['sourceDB']
     VerticaMigrator('SourceDSN', 'TargetDSN', False)
Exemple #4
0
 def get_migrator(self, sanity_checks, set_connections, **kwargs):
     migrator = VerticaMigrator('SourceDSN', 'TargetDSN', False, **kwargs)
     return migrator