From 899a4b1b67385a572400f8909ae37c874897335a Mon Sep 17 00:00:00 2001 From: Emilio Mayorga Date: Sat, 20 Apr 2019 19:02:09 -0700 Subject: [PATCH 1/2] Updated odm2api module path calls in tests/test_odm2 modules to remove deprecated use of ODM2 module hierarchy. --- tests/test_SessionFactory.py | 2 +- tests/test_connection.py | 2 +- tests/test_odm2/test_createservice.py | 4 ++-- tests/test_odm2/test_model.py | 4 ++-- tests/test_odm2/test_odm2.py | 10 +++++----- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/test_SessionFactory.py b/tests/test_SessionFactory.py index adcb446..531d658 100644 --- a/tests/test_SessionFactory.py +++ b/tests/test_SessionFactory.py @@ -1,6 +1,6 @@ from __future__ import (absolute_import, division, print_function) -from odm2api.ODM2.models import CVElevationDatum, setSchema +from odm2api.models import CVElevationDatum, setSchema from odm2api.ODMconnection import SessionFactory import pytest diff --git a/tests/test_connection.py b/tests/test_connection.py index a8bfacf..aabcf8a 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -1,6 +1,6 @@ from __future__ import (absolute_import, division, print_function) -from odm2api.ODM2.models import CVElevationDatum +from odm2api.models import CVElevationDatum from odm2api.ODMconnection import dbconnection import pytest diff --git a/tests/test_odm2/test_createservice.py b/tests/test_odm2/test_createservice.py index cff0466..9b267b9 100644 --- a/tests/test_odm2/test_createservice.py +++ b/tests/test_odm2/test_createservice.py @@ -4,8 +4,8 @@ import uuid from os.path import abspath, dirname, join -from odm2api.ODM2 import models -from odm2api.ODM2.services.createService import CreateODM2 +from odm2api import models +from odm2api.services.createService import CreateODM2 from odm2api.ODMconnection import dbconnection import pytest diff --git a/tests/test_odm2/test_model.py b/tests/test_odm2/test_model.py index 82c6283..9ecfe59 100644 --- a/tests/test_odm2/test_model.py +++ b/tests/test_odm2/test_model.py @@ -1,7 +1,7 @@ from __future__ import (absolute_import, division, print_function) -from odm2api.ODM2.models import (CVElevationDatum, CVSamplingFeatureGeoType, - CVSamplingFeatureType, SamplingFeatures) +from odm2api.models import (CVElevationDatum, CVSamplingFeatureGeoType, + CVSamplingFeatureType, SamplingFeatures) import pytest diff --git a/tests/test_odm2/test_odm2.py b/tests/test_odm2/test_odm2.py index a50f470..5b3cd16 100644 --- a/tests/test_odm2/test_odm2.py +++ b/tests/test_odm2/test_odm2.py @@ -1,10 +1,10 @@ from __future__ import (absolute_import, division, print_function) -from odm2api.ODM2.models import Methods, Models, People, ProcessingLevels, RelatedModels, Variables -from odm2api.ODM2.services.createService import CreateODM2 -from odm2api.ODM2.services.deleteService import DeleteODM2 -from odm2api.ODM2.services.readService import ReadODM2 -from odm2api.ODM2.services.updateService import UpdateODM2 +from odm2api.models import Methods, Models, People, ProcessingLevels, RelatedModels, Variables +from odm2api.services.createService import CreateODM2 +from odm2api.services.deleteService import DeleteODM2 +from odm2api.services.readService import ReadODM2 +from odm2api.services.updateService import UpdateODM2 from odm2api.ODMconnection import dbconnection import pytest From e4b93d94e4013f08760c9eb8e3c6f8903a75ed60 Mon Sep 17 00:00:00 2001 From: Emilio Mayorga Date: Sat, 20 Apr 2019 20:24:00 -0700 Subject: [PATCH 2/2] flake8 code standard fixes on tests --- tests/test_SessionFactory.py | 6 +++--- tests/test_connection.py | 4 ++-- tests/test_odm2/test_createservice.py | 2 +- tests/test_odm2/test_odm2.py | 5 +++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/test_SessionFactory.py b/tests/test_SessionFactory.py index 531d658..7030878 100644 --- a/tests/test_SessionFactory.py +++ b/tests/test_SessionFactory.py @@ -1,7 +1,7 @@ from __future__ import (absolute_import, division, print_function) -from odm2api.models import CVElevationDatum, setSchema from odm2api.ODMconnection import SessionFactory +from odm2api.models import CVElevationDatum, setSchema import pytest @@ -15,10 +15,10 @@ ['mysql"root@Localhost/odm2', 'mysql', 'mysql+pymysql://root@localhost/odm2'], ['postgresql_marchantariats_none', 'postgresql', 'postgresql+psycopg2://postgres:None@localhost/marchantariats', - 'marchantariats', 'postgres', None], + 'marchantariats', 'postgres', None], ['postgresql_marchantariats_empty', 'postgresql', 'postgresql+psycopg2://postgres@localhost/marchantariats', - 'marchantariats', 'postgres', None], + 'marchantariats', 'postgres', None], ['sqlite_wof', 'sqlite', 'sqlite:///./tests/spatialite/wof2odm/ODM2.sqlite', None, None, None] ] diff --git a/tests/test_connection.py b/tests/test_connection.py index aabcf8a..b28d370 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -1,7 +1,7 @@ from __future__ import (absolute_import, division, print_function) -from odm2api.models import CVElevationDatum from odm2api.ODMconnection import dbconnection +from odm2api.models import CVElevationDatum import pytest @@ -13,7 +13,7 @@ dbs_readonly = [ ['mysql_odm2_odm', 'mysql', 'localhost', 'odm2', 'ODM', 'odm'], ['mysql_odm2_root', 'mysql', 'localhost', 'odm2', 'root', None], - ['postgresql_marchantariats', 'postgresql', 'localhost', 'marchantariats', 'postgres', 'iforget'], + ['postgresql_marchantariats', 'postgresql', 'localhost', 'marchantariats', 'postgres', 'iforget'], ['sqlite_wof', 'sqlite', './tests/spatialite/wof2odm/ODM2.sqlite', None, None, None] ] diff --git a/tests/test_odm2/test_createservice.py b/tests/test_odm2/test_createservice.py index 9b267b9..a59c387 100644 --- a/tests/test_odm2/test_createservice.py +++ b/tests/test_odm2/test_createservice.py @@ -5,8 +5,8 @@ from os.path import abspath, dirname, join from odm2api import models -from odm2api.services.createService import CreateODM2 from odm2api.ODMconnection import dbconnection +from odm2api.services.createService import CreateODM2 import pytest # run this test from the root directory using: diff --git a/tests/test_odm2/test_odm2.py b/tests/test_odm2/test_odm2.py index 5b3cd16..ee1713d 100644 --- a/tests/test_odm2/test_odm2.py +++ b/tests/test_odm2/test_odm2.py @@ -1,11 +1,12 @@ from __future__ import (absolute_import, division, print_function) -from odm2api.models import Methods, Models, People, ProcessingLevels, RelatedModels, Variables +from odm2api.ODMconnection import dbconnection +from odm2api.models import (Methods, Models, People, + ProcessingLevels, RelatedModels, Variables) from odm2api.services.createService import CreateODM2 from odm2api.services.deleteService import DeleteODM2 from odm2api.services.readService import ReadODM2 from odm2api.services.updateService import UpdateODM2 -from odm2api.ODMconnection import dbconnection import pytest