Skip to content

Commit

Permalink
[Fixes #227] Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiagiupponi committed May 3, 2024
1 parent ae44f5c commit f7e5d59
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
4 changes: 3 additions & 1 deletion importer/handlers/common/tests_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ def test_import_resource_should_not_be_imported(self, celery_chord, ogr2ogr_driv
files=self.valid_files, execution_id=str(exec_id)
)
self.assertIn(
"No valid layers found", exception.exception.args[0], 'No valid layers found.'
"No valid layers found",
exception.exception.args[0],
"No valid layers found.",
)

celery_chord.assert_not_called()
Expand Down
2 changes: 0 additions & 2 deletions importer/orchestrator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import logging
import os
from typing import Optional
from uuid import UUID

Expand All @@ -9,7 +8,6 @@
from django.utils import timezone
from django.utils.module_loading import import_string
from django_celery_results.models import TaskResult
from geonode.base.enumerations import STATE_INVALID, STATE_PROCESSED, STATE_RUNNING
from geonode.resource.models import ExecutionRequest
from geonode.storage.manager import storage_manager
from rest_framework import serializers
Expand Down
3 changes: 1 addition & 2 deletions importer/tests/unit/test_orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from django.utils import timezone
from django_celery_results.models import TaskResult

from geonode.base import enumerations as enum
from geonode.resource.models import ExecutionRequest

# Create your tests here.
Expand Down Expand Up @@ -95,7 +94,7 @@ def test_create_execution_request(self):
exec_obj = ExecutionRequest.objects.filter(exec_id=exec_id).first()
self.assertEqual(count + 1, ExecutionRequest.objects.count())
self.assertDictEqual(input_files, exec_obj.input_params)
self.assertEqual(exec_obj.STATUS_READY, exec_obj.status))
self.assertEqual(exec_obj.STATUS_READY, exec_obj.status)

@patch("importer.orchestrator.importer_app.tasks.get")
def test_perform_next_step(self, mock_celery):
Expand Down
2 changes: 0 additions & 2 deletions importer/tests/unit/test_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ def test_publish_resource_if_overwrite_should_call_the_publishing(
user=get_user_model().objects.get(username=self.user),
func_name="dummy_func",
step="dummy_step",
legacy_upload_name="dummy",
input_params={
"files": {"base_file": "/filepath"},
"overwrite_existing_layer": True,
Expand Down Expand Up @@ -239,7 +238,6 @@ def test_publish_resource_if_overwrite_should_not_call_the_publishing(
user=get_user_model().objects.get(username=self.user),
func_name="dummy_func",
step="dummy_step",
legacy_upload_name="dummy",
input_params={
"files": {"base_file": "/filepath"},
"overwrite_existing_layer": True,
Expand Down

0 comments on commit f7e5d59

Please sign in to comment.