summaryrefslogtreecommitdiff
path: root/tests/__init__.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-04-05 13:33:37 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2012-04-05 13:33:37 -0400
commit8332e56a18e30ebc5c74bf782f6ad42d14ea9814 (patch)
tree77376be5ec647966d29deee768a4eddb90cca94e /tests/__init__.py
parent67fda40a43c79f532f5d3c4f041e2203a126fffd (diff)
downloadalembic-8332e56a18e30ebc5c74bf782f6ad42d14ea9814.tar.gz
- move to 0.3 as we are changing APIrel_0_3_0
- [general] The focus of 0.3 is to clean up and more fully document the public API of Alembic, including better accessors on the MigrationContext and ScriptDirectory objects. Methods that are not considered to be public on these objects have been underscored, and methods which should be public have been cleaned up and documented, including: MigrationContext.get_current_revision() ScriptDirectory.iterate_revisions() ScriptDirectory.get_current_head() ScriptDirectory.get_heads() ScriptDirectory.get_base() ScriptDirectory.generate_revision() - [feature] Added a bit of autogenerate to the public API in the form of the function alembic.autogenerate.compare_metadata.
Diffstat (limited to 'tests/__init__.py')
-rw-r--r--tests/__init__.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/__init__.py b/tests/__init__.py
index e8baba8..d3193ae 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -121,6 +121,10 @@ def ne_(a, b, msg=None):
"""Assert a != b, with repr messaging on failure."""
assert a != b, msg or "%r == %r" % (a, b)
+def is_(a, b, msg=None):
+ """Assert a is b, with repr messaging on failure."""
+ assert a is b, msg or "%r is not %r" % (a, b)
+
def assert_raises_message(except_cls, msg, callable_, *args, **kwargs):
try:
callable_(*args, **kwargs)
@@ -294,7 +298,7 @@ def write_script(scriptdir, rev_id, content):
pyc_path = util.pyc_file_from_path(path)
if os.access(pyc_path, os.F_OK):
os.unlink(pyc_path)
- script = Script.from_path(path)
+ script = Script._from_path(path)
old = scriptdir._revision_map[script.revision]
if old.down_revision != script.down_revision:
raise Exception("Can't change down_revision "
@@ -309,7 +313,7 @@ def three_rev_fixture(cfg):
c = util.rev_id()
script = ScriptDirectory.from_config(cfg)
- script.generate_rev(a, "revision a", refresh=True)
+ script.generate_revision(a, "revision a", refresh=True)
write_script(script, a, """
revision = '%s'
down_revision = None
@@ -324,7 +328,7 @@ def downgrade():
""" % a)
- script.generate_rev(b, "revision b", refresh=True)
+ script.generate_revision(b, "revision b", refresh=True)
write_script(script, b, """
revision = '%s'
down_revision = '%s'
@@ -339,7 +343,7 @@ def downgrade():
""" % (b, a))
- script.generate_rev(c, "revision c", refresh=True)
+ script.generate_revision(c, "revision c", refresh=True)
write_script(script, c, """
revision = '%s'
down_revision = '%s'