From: Mike Bayer Date: Thu, 19 Sep 2019 22:37:28 +0000 (-0400) Subject: Fix NormPathTest again....to not have my workstation paths in it :) X-Git-Tag: rel_1_2_0~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=049e8303b42b70df562a9e33bbb4aa66f99b2824;p=thirdparty%2Fsqlalchemy%2Falembic.git Fix NormPathTest again....to not have my workstation paths in it :) Change-Id: I743f7ec9379a09a4ade4f4e4b03e586c0b06517b --- 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:"), ], )