Skip to content

Commit

Permalink
Fix github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiagiupponi committed Feb 1, 2024
1 parent 150d77d commit 794dc71
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions importer/handlers/common/tests_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def test_import_with_ogr2ogr_without_errors_should_call_the_right_command(

_open.assert_called_once()
_open.assert_called_with(
f'/usr/bin/ogr2ogr --config PG_USE_COPY YES -f PostgreSQL PG:" dbname=\'test_geonode_data\' host={host=' + {os.getenv('DATABASE_HOST', 'localhost')} + '} port=5432 user=\'geonode_data\' password=\'geonode_data\' " "{self.valid_files.get("base_file")}" -nln alternate "dataset"',
f'/usr/bin/ogr2ogr --config PG_USE_COPY YES -f PostgreSQL PG:" dbname=\'test_geonode_data\' host=' + {os.getenv('DATABASE_HOST', 'localhost')} + '} port=5432 user=\'geonode_data\' password=\'geonode_data\' " "{self.valid_files.get("base_file")}" -nln alternate "dataset"',
stdout=-1,
stderr=-1,
shell=True, # noqa
Expand All @@ -252,7 +252,7 @@ def test_import_with_ogr2ogr_with_errors_should_raise_exception(self, _open):

_open.assert_called_once()
_open.assert_called_with(
f'/usr/bin/ogr2ogr --config PG_USE_COPY YES -f PostgreSQL PG:" dbname=\'test_geonode_data\' host={host=' + {os.getenv('DATABASE_HOST', 'localhost')} + '} port=5432 user=\'geonode_data\' password=\'geonode_data\' " "{self.valid_files.get("base_file")}" -nln alternate "dataset"',
f'/usr/bin/ogr2ogr --config PG_USE_COPY YES -f PostgreSQL PG:" dbname=\'test_geonode_data\' host=' + {os.getenv('DATABASE_HOST', 'localhost')} + '} port=5432 user=\'geonode_data\' password=\'geonode_data\' " "{self.valid_files.get("base_file")}" -nln alternate "dataset"',
stdout=-1,
stderr=-1,
shell=True, # noqa
Expand Down
4 changes: 2 additions & 2 deletions importer/handlers/csv/tests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import uuid
from unittest.mock import MagicMock, patch

import os
from django.contrib.auth import get_user_model
from django.test import TestCase
from geonode.base.populate_test_data import create_single_dataset
Expand Down Expand Up @@ -165,7 +165,7 @@ def test_import_with_ogr2ogr_without_errors_should_call_the_right_command(

_open.assert_called_once()
_open.assert_called_with(
f'/usr/bin/ogr2ogr --config PG_USE_COPY YES -f PostgreSQL PG:" dbname=\'test_geonode_data\' host={host=' + {os.getenv('DATABASE_HOST', 'localhost')} + '} port=5432 user=\'geonode_data\' password=\'geonode_data\' " "{self.valid_csv}" -nln alternate "dataset" -oo KEEP_GEOM_COLUMNS=NO -lco GEOMETRY_NAME=geometry -oo "GEOM_POSSIBLE_NAMES=geom*,the_geom*,wkt_geom" -oo "X_POSSIBLE_NAMES=x,long*" -oo "Y_POSSIBLE_NAMES=y,lat*"',
f'/usr/bin/ogr2ogr --config PG_USE_COPY YES -f PostgreSQL PG:" dbname=\'test_geonode_data\' host=' + {os.getenv('DATABASE_HOST', 'localhost')} + '} port=5432 user=\'geonode_data\' password=\'geonode_data\' " "{self.valid_csv}" -nln alternate "dataset" -oo KEEP_GEOM_COLUMNS=NO -lco GEOMETRY_NAME=geometry -oo "GEOM_POSSIBLE_NAMES=geom*,the_geom*,wkt_geom" -oo "X_POSSIBLE_NAMES=x,long*" -oo "Y_POSSIBLE_NAMES=y,lat*"',
stdout=-1,
stderr=-1,
shell=True, # noqa
Expand Down
3 changes: 2 additions & 1 deletion importer/handlers/geojson/tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import uuid
import os
from django.test import TestCase
from mock import MagicMock, patch
from importer.handlers.common.vector import import_with_ogr2ogr
Expand Down Expand Up @@ -130,7 +131,7 @@ def test_import_with_ogr2ogr_without_errors_should_call_the_right_command(

_open.assert_called_once()
_open.assert_called_with(
f'/usr/bin/ogr2ogr --config PG_USE_COPY YES -f PostgreSQL PG:" dbname=\'test_geonode_data\' host={host=' + {os.getenv('DATABASE_HOST', 'localhost')} + '} port=5432 user=\'geonode_data\' password=\'geonode_data\' " "{self.valid_files.get("base_file")}" -nln alternate "dataset" -lco GEOMETRY_NAME=geometry',
f'/usr/bin/ogr2ogr --config PG_USE_COPY YES -f PostgreSQL PG:" dbname=\'test_geonode_data\' host=' + {os.getenv('DATABASE_HOST', 'localhost')} + 'port=5432 user=\'geonode_data\' password=\'geonode_data\' " "{self.valid_files.get("base_file")}" -nln alternate "dataset" -lco GEOMETRY_NAME=geometry',
stdout=-1,
stderr=-1,
shell=True, # noqa
Expand Down
2 changes: 1 addition & 1 deletion runtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
set -a
. ./.env_test
set +a
coverage run --append --source='.' /usr/src/geonode/manage.py test importer --keepdb -v2 --noinput
coverage run --append --source='.' /usr/src/geonode/manage.py test importer -v2 --noinput

0 comments on commit 794dc71

Please sign in to comment.