def test_run_migration_file_unsupported(self): ''' Raise an exception if the database type is not supported. ''' config = self.config_fixture(type='bogusdb') backup_file = Mock() with self.assertRaises(ValueError): process = agnostic._run_migration_file(config, backup_file)
def test_run_migration_file(self, popen_mock): ''' Restore from a backup. ''' expected_process = 'dummy_process' popen_mock.return_value = expected_process config = self.config_fixture() migration_file = '01_foo' actual_process = agnostic._run_migration_file(config, migration_file) self.assertEqual(actual_process, expected_process)