Skip to content

Commit

Permalink
Use updated portal credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
mmorang committed Apr 30, 2021
1 parent 844510a commit a1bafb5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ LargeNetworkAnalysisTools.pyt.xml

/unittests/TestInput
/unittests/TestOutput
unittests/portal_credentials.py
13 changes: 6 additions & 7 deletions unittests/unittests_odcm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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(
Expand Down
13 changes: 6 additions & 7 deletions unittests/unittests_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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(
Expand Down

0 comments on commit a1bafb5

Please sign in to comment.