From a1bafb545ca2c8f15896a93e1b51d72d4224c7d5 Mon Sep 17 00:00:00 2001 From: Melinda Morang Date: Fri, 30 Apr 2021 10:10:49 -0700 Subject: [PATCH] Use updated portal credentials --- .gitignore | 1 - unittests/unittests_odcm.py | 13 ++++++------- unittests/unittests_tool.py | 13 ++++++------- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index bd18808..3532150 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,3 @@ LargeNetworkAnalysisTools.pyt.xml /unittests/TestInput /unittests/TestOutput -unittests/portal_credentials.py diff --git a/unittests/unittests_odcm.py b/unittests/unittests_odcm.py index 7d570c5..4747958 100644 --- a/unittests/unittests_odcm.py +++ b/unittests/unittests_odcm.py @@ -18,20 +18,19 @@ import datetime import unittest from copy import deepcopy - import arcpy +import portal_credentials # Contains log-in for an ArcGIS Online account to use as a test portal CWD = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.dirname(CWD)) -import odcm # noqa: E402 -import portal_credentials # Contains log-in for an ArcGIS Online account to use as a test portal # noqa: E402 +import odcm # noqa: E402, pylint: disable=wrong-import-position class TestODCM(unittest.TestCase): '''Test cases for the odcm module.''' @classmethod - def setUpClass(self): + def setUpClass(self): # pylint: disable=bad-classmethod-argument self.maxDiff = None self.input_data_folder = os.path.join(CWD, "TestInput") @@ -41,10 +40,10 @@ def setUpClass(self): self.local_nd = os.path.join(sf_gdb, "Transportation", "Streets_ND") self.local_tm_time = "Driving Time" self.local_tm_dist = "Driving Distance" - self.portal_nd = portal_credentials.portal_url - self.portal_tm = portal_credentials.portal_travel_mode + self.portal_nd = portal_credentials.PORTAL_URL + self.portal_tm = portal_credentials.PORTAL_TRAVEL_MODE - arcpy.SignInToPortal(self.portal_nd, portal_credentials.portal_username, portal_credentials.portal_password) + arcpy.SignInToPortal(self.portal_nd, portal_credentials.PORTAL_USERNAME, portal_credentials.PORTAL_PASSWORD) # Create a unique output directory and gdb for this test self.output_folder = os.path.join( diff --git a/unittests/unittests_tool.py b/unittests/unittests_tool.py index 5142403..ef16593 100644 --- a/unittests/unittests_tool.py +++ b/unittests/unittests_tool.py @@ -19,20 +19,19 @@ import os import datetime import unittest - import arcpy +import portal_credentials CWD = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.dirname(CWD)) -import odcm # noqa: E402 -import portal_credentials # noqa: E402 +import odcm # noqa: E402, pylint: disable=wrong-import-position class TestSolveLargeODCostMatrixTool(unittest.TestCase): '''Test cases for the SolveLargeODCostMatrix script tool.''' @classmethod - def setUpClass(self): + def setUpClass(self): # pylint: disable=bad-classmethod-argument self.maxDiff = None tbx_path = os.path.join(os.path.dirname(CWD), "LargeNetworkAnalysisTools.pyt") @@ -45,10 +44,10 @@ def setUpClass(self): self.local_nd = os.path.join(sf_gdb, "Transportation", "Streets_ND") self.local_tm_time = "Driving Time" self.local_tm_dist = "Driving Distance" - self.portal_nd = portal_credentials.portal_url # Must be arcgis.com for test to work - self.portal_tm = portal_credentials.portal_travel_mode + self.portal_nd = portal_credentials.PORTAL_URL # Must be arcgis.com for test to work + self.portal_tm = portal_credentials.PORTAL_TRAVEL_MODE - arcpy.SignInToPortal(self.portal_nd, portal_credentials.portal_username, portal_credentials.portal_password) + arcpy.SignInToPortal(self.portal_nd, portal_credentials.PORTAL_USERNAME, portal_credentials.PORTAL_PASSWORD) # Create a unique output directory and gdb for this test self.output_folder = os.path.join(