summaryrefslogtreecommitdiff
path: root/tests/test_script_production.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2019-09-19 17:45:18 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2019-09-19 17:45:18 -0400
commit63bbcd0df8e61ceaa734ec39ed9d5de6fff42308 (patch)
treed820c6290e2687de76ce545784e74e7f7e301eb2 /tests/test_script_production.py
parent0ea6f4118b9e503da793f445a26c1c4e865f87a4 (diff)
downloadalembic-63bbcd0df8e61ceaa734ec39ed9d5de6fff42308.tar.gz
Fix the NormPathTest to accommodate for multi-process staging directories
Change-Id: Ie1659e51f889bca5d1fe30eb52bc1d5a7aef097c
Diffstat (limited to 'tests/test_script_production.py')
-rw-r--r--tests/test_script_production.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/test_script_production.py b/tests/test_script_production.py
index 802a256..7188bba 100644
--- a/tests/test_script_production.py
+++ b/tests/test_script_production.py
@@ -1270,22 +1270,23 @@ 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:scratch:NORM:scripts:NORM:versions",
+ ":NORM:%s:NORM:scripts:NORM:versions" % normstaging,
),
)
eq_(
script.versions,
- ":NORM:home:NORM:classic:NORM:dev:NORM:alembic:NORM:scratch:"
- "NORM:scripts:NORM:versions",
+ ":NORM:home:NORM:classic:NORM:dev:NORM:alembic:NORM:%s:"
+ "NORM:scripts:NORM:versions" % normstaging,
)
- eq_(script.dir, "scratch/scripts")
+ eq_(script.dir, "%s/scripts" % normstaging)
def test_script_location_muliple(self):
config = _multi_dir_testing_config()
@@ -1296,15 +1297,17 @@ 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:scratch:NORM:model1:NORM:",
+ ":NORM:%s:NORM:model1:NORM:" % normstaging,
":NORM:home:NORM:classic:NORM:dev:NORM:alembic"
- ":NORM:scratch:NORM:model2:NORM:",
+ ":NORM:%s:NORM:model2:NORM:" % normstaging,
":NORM:home:NORM:classic:NORM:dev:NORM:alembic"
- ":NORM:scratch:NORM:model3:NORM:",
+ ":NORM:%s:NORM:model3:NORM:" % normstaging,
],
)