]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
Fix NormPathTest again....to not have my workstation paths in it :)
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 19 Sep 2019 22:37:28 +0000 (18:37 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 19 Sep 2019 22:37:28 +0000 (18:37 -0400)
Change-Id: I743f7ec9379a09a4ade4f4e4b03e586c0b06517b

tests/test_script_production.py

index 7188bba0bd69abe3cd5b4638f2e6ee6411d48d5d..4c1bec1dd5d9aadc6ae0324517fea2fadc5d376d 100644 (file)
@@ -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:"),
                 ],
             )