From 049e8303b42b70df562a9e33bbb4aa66f99b2824 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 19 Sep 2019 18:37:28 -0400 Subject: [PATCH] Fix NormPathTest again....to not have my workstation paths in it :) Change-Id: I743f7ec9379a09a4ade4f4e4b03e586c0b06517b --- tests/test_script_production.py | 34 +++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/tests/test_script_production.py b/tests/test_script_production.py index 7188bba0..4c1bec1d 100644 --- a/tests/test_script_production.py +++ b/tests/test_script_production.py @@ -1270,24 +1270,28 @@ class NormPathTest(TestBase): return path.replace("/", ":NORM:") normpath = mock.Mock(side_effect=normpath) - normstaging = _get_staging_directory().replace("/", ":NORM:") + with mock.patch("os.path.normpath", normpath): eq_( script._version_locations, ( - ":NORM:home:NORM:classic:NORM:dev:NORM:alembic" - ":NORM:%s:NORM:scripts:NORM:versions" % normstaging, + os.path.abspath( + os.path.join( + _get_staging_directory(), "scripts", "versions" + ) + ).replace("/", ":NORM:"), ), ) eq_( script.versions, - ":NORM:home:NORM:classic:NORM:dev:NORM:alembic:NORM:%s:" - "NORM:scripts:NORM:versions" % normstaging, + os.path.abspath( + os.path.join( + _get_staging_directory(), "scripts", "versions" + ) + ).replace("/", ":NORM:"), ) - eq_(script.dir, "%s/scripts" % normstaging) - def test_script_location_muliple(self): config = _multi_dir_testing_config() @@ -1297,17 +1301,19 @@ class NormPathTest(TestBase): return path.replace("/", ":NORM:") normpath = mock.Mock(side_effect=normpath) - normstaging = _get_staging_directory().replace("/", ":NORM:") with mock.patch("os.path.normpath", normpath): eq_( script._version_locations, [ - ":NORM:home:NORM:classic:NORM:dev:NORM:alembic" - ":NORM:%s:NORM:model1:NORM:" % normstaging, - ":NORM:home:NORM:classic:NORM:dev:NORM:alembic" - ":NORM:%s:NORM:model2:NORM:" % normstaging, - ":NORM:home:NORM:classic:NORM:dev:NORM:alembic" - ":NORM:%s:NORM:model3:NORM:" % normstaging, + os.path.abspath( + os.path.join(_get_staging_directory(), "model1/") + ).replace("/", ":NORM:"), + os.path.abspath( + os.path.join(_get_staging_directory(), "model2/") + ).replace("/", ":NORM:"), + os.path.abspath( + os.path.join(_get_staging_directory(), "model3/") + ).replace("/", ":NORM:"), ], ) -- 2.47.2