Ejemplo n.º 1
0
    def test_restore_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._restore(config, backup_file)
Ejemplo n.º 2
0
    def test_restore(self, popen_mock):
        ''' Restore from a backup. '''

        expected_process = 'dummy_process'
        popen_mock.return_value = expected_process
        config = self.config_fixture()
        snapshot_file = Mock()

        actual_process = agnostic._restore(config, snapshot_file)

        self.assertEqual(actual_process, expected_process)