Beispiel #1
0
    def test_api_notify(self, mock_delay):
        request = self.mk_request()
        request.method = "POST"

        views = CoreViews(request)
        response = views.api_notify()
        mock_delay.assert_called_once()
        (working_dir, index_prefix), _ = mock_delay.call_args_list[0]
        self.assertEqual(response, {})
        self.assertEqual(working_dir, self.workspace.working_dir)
        self.assertEqual(index_prefix, self.workspace.index_prefix)
Beispiel #2
0
    def test_api_notify(self, mock_delay):
        request = self.mk_request()
        request.method = 'POST'

        views = CoreViews(request)
        response = views.api_notify()
        mock_delay.assert_called_once()
        (working_dir, index_prefix), _ = mock_delay.call_args_list[0]
        self.assertEqual(response, {})
        self.assertEqual(working_dir, self.workspace.working_dir)
        self.assertEqual(index_prefix, self.workspace.index_prefix)
Beispiel #3
0
    def test_api_notify(self, mock_delay):
        request = self.mk_request()
        request.method = 'POST'

        views = CoreViews(request)
        response = views.api_notify()
        self.assertEqual(mock_delay.call_count, 1)
        args, kwargs = mock_delay.call_args
        self.assertEqual(response, {})
        self.assertEqual(kwargs['repo_url'], self.workspace.working_dir)
        self.assertEqual(kwargs['index_prefix'], self.workspace.index_prefix)
        self.assertEqual(kwargs['es'], views.es_settings)