def test_load_snapshot_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._load_snapshot(config, backup_file)
def test_load_snapshot(self, popen_mock): ''' Load a schema snapshot. ''' expected_process = 'dummy_process' popen_mock.return_value = expected_process config = self.config_fixture() snapshot_file = Mock() actual_process = agnostic._load_snapshot(config, snapshot_file) self.assertEqual(actual_process, expected_process)