if env_token:
assert_lines.insert(0, "environment included OK")
+ actual = (
+ buf.getvalue()
+ .decode("ascii", "replace")
+ .replace(os.linesep, "\n")
+ .strip()
+ )
eq_(
- buf.getvalue().decode("ascii", "replace").strip(),
+ actual,
"\n".join(assert_lines)
.encode("ascii", "replace")
.decode("ascii")
command.stamp(self.cfg, "base")
def test_edit_head(self):
- expected_call_arg = "%s/scripts/versions/%s_revision_c.py" % (
- EditTest.cfg.config_args["here"],
- EditTest.c,
+ expected_call_arg = os.path.normpath(
+ "%s/scripts/versions/%s_revision_c.py"
+ % (EditTest.cfg.config_args["here"], EditTest.c,)
)
with mock.patch("alembic.util.edit") as edit:
edit.assert_called_with(expected_call_arg)
def test_edit_b(self):
- expected_call_arg = "%s/scripts/versions/%s_revision_b.py" % (
- EditTest.cfg.config_args["here"],
- EditTest.b,
+ expected_call_arg = os.path.normpath(
+ "%s/scripts/versions/%s_revision_b.py"
+ % (EditTest.cfg.config_args["here"], EditTest.b,)
)
with mock.patch("alembic.util.edit") as edit:
)
def test_edit_current(self):
- expected_call_arg = "%s/scripts/versions/%s_revision_b.py" % (
- EditTest.cfg.config_args["here"],
- EditTest.b,
+ expected_call_arg = os.path.normpath(
+ "%s/scripts/versions/%s_revision_b.py"
+ % (EditTest.cfg.config_args["here"], EditTest.b,)
)
command.stamp(self.cfg, self.b)
"alembic.command.ScriptDirectory"
):
command.init(self.cfg, directory="foobar")
- eq_(makedirs.mock_calls, [mock.call("foobar/versions")])
+ eq_(
+ makedirs.mock_calls,
+ [mock.call(os.path.normpath("foobar/versions"))],
+ )
def test_init_file_doesnt_exist(self):
def access_(path, mode):
command.init(self.cfg, directory="foobar")
eq_(
makedirs.mock_calls,
- [mock.call("foobar"), mock.call("foobar/versions")],
+ [
+ mock.call("foobar"),
+ mock.call(os.path.normpath("foobar/versions")),
+ ],
)
def test_init_w_package(self):