Exemple #1
0
def test_copy_analytic_store():
    # Create a dummy session
    with mock.patch('sasctl.core.requests.Session.request'):
        current_session('example.com', 'user', 'password')

    MODEL_ID = 12345
    # Intercept calls to lookup the model & call the "copyAnalyticStore" link
    with mock.patch('sasctl._services.model_repository.ModelRepository'
                    '.get_model') as get_model:
        with mock.patch('sasctl._services.model_repository.ModelRepository'
                        '.request_link') as request_link:

            # Return a dummy Model with a static id
            get_model.return_value = {'id': MODEL_ID}
            mr.copy_analytic_store(MODEL_ID)

            # Should have been called once by default, and again to refresh
            # links
            assert get_model.call_count == 2
            assert request_link.call_count == 1

            args, _ = request_link.call_args
            obj, rel = args
            assert obj == get_model.return_value
            assert rel == 'copyAnalyticStore'
Exemple #2
0
    def test_copy_astore(self):
        job = mr.copy_analytic_store(self.model_name)

        assert job.state == 'pending'
    def test_copy_astore(self):
        """Copy the ASTORE to filesystem for MAS"""
        job = mr.copy_analytic_store(self.MODEL_NAME)

        assert job.state == 'pending'