Example #1
0
    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)
Example #2
0
    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)