diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-11-28 17:11:14 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-11-28 17:11:14 -0500 |
commit | 48ecd445cfaebad67a143480109586075dcb9ea0 (patch) | |
tree | 5d206071ef5c316c8f7aee40c5e906ecbfea7382 /tests/test_offline_environment.py | |
parent | 2c95bcf4fea3bd8942e4e4c4a0c5d0902dabef62 (diff) | |
download | alembic-48ecd445cfaebad67a143480109586075dcb9ea0.tar.gz |
- some test cleanup
- add support for actual DB connections, test.cfg, etc.
- add PG server default comparison tests, #6
Diffstat (limited to 'tests/test_offline_environment.py')
-rw-r--r-- | tests/test_offline_environment.py | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/tests/test_offline_environment.py b/tests/test_offline_environment.py index a71bb99..1bd0c89 100644 --- a/tests/test_offline_environment.py +++ b/tests/test_offline_environment.py @@ -1,6 +1,6 @@ from tests import clear_staging_env, staging_env, \ - _no_sql_testing_config, sqlite_db, eq_, ne_, \ - capture_context_buffer, three_rev_fixture, _env_file_fixture,\ + no_sql_testing_config, sqlite_db, eq_, ne_, \ + capture_context_buffer, three_rev_fixture, env_file_fixture,\ assert_raises_message from alembic import command, util from unittest import TestCase @@ -9,7 +9,7 @@ from unittest import TestCase class OfflineEnvironmentTest(TestCase): def setUp(self): env = staging_env() - self.cfg = _no_sql_testing_config() + self.cfg = no_sql_testing_config() global a, b, c a, b, c = three_rev_fixture(self.cfg) @@ -18,14 +18,14 @@ class OfflineEnvironmentTest(TestCase): clear_staging_env() def test_not_requires_connection(self): - _env_file_fixture(""" + env_file_fixture(""" assert not context.requires_connection() """) command.upgrade(self.cfg, a, sql=True) command.downgrade(self.cfg, a, sql=True) def test_requires_connection(self): - _env_file_fixture(""" + env_file_fixture(""" assert context.requires_connection() """) command.upgrade(self.cfg, a) @@ -33,7 +33,7 @@ assert context.requires_connection() def test_starting_rev_post_context(self): - _env_file_fixture(""" + env_file_fixture(""" context.configure(dialect_name='sqlite', starting_rev='x') assert context.get_starting_revision_argument() == 'x' """) @@ -43,7 +43,7 @@ assert context.get_starting_revision_argument() == 'x' command.stamp(self.cfg, a) def test_starting_rev_pre_context(self): - _env_file_fixture(""" + env_file_fixture(""" assert context.get_starting_revision_argument() == 'x' """) command.upgrade(self.cfg, "x:y", sql=True) @@ -51,7 +51,7 @@ assert context.get_starting_revision_argument() == 'x' command.stamp(self.cfg, a) def test_starting_rev_current_pre_context(self): - _env_file_fixture(""" + env_file_fixture(""" assert context.get_starting_revision_argument() is None """) assert_raises_message( @@ -61,7 +61,7 @@ assert context.get_starting_revision_argument() is None ) def test_destination_rev_pre_context(self): - _env_file_fixture(""" + env_file_fixture(""" assert context.get_revision_argument() == '%s' """ % b) command.upgrade(self.cfg, b, sql=True) @@ -69,7 +69,7 @@ assert context.get_revision_argument() == '%s' command.stamp(self.cfg, b, sql=True) def test_destination_rev_post_context(self): - _env_file_fixture(""" + env_file_fixture(""" context.configure(dialect_name='sqlite') assert context.get_revision_argument() == '%s' """ % b) @@ -78,7 +78,7 @@ assert context.get_revision_argument() == '%s' command.stamp(self.cfg, b, sql=True) def test_head_rev_pre_context(self): - _env_file_fixture(""" + env_file_fixture(""" assert context.get_head_revision() == '%s' """ % c) command.upgrade(self.cfg, b, sql=True) @@ -87,7 +87,7 @@ assert context.get_head_revision() == '%s' command.current(self.cfg) def test_head_rev_post_context(self): - _env_file_fixture(""" + env_file_fixture(""" context.configure(dialect_name='sqlite') assert context.get_head_revision() == '%s' """ % c) @@ -97,21 +97,21 @@ assert context.get_head_revision() == '%s' command.current(self.cfg) def test_tag_pre_context(self): - _env_file_fixture(""" + env_file_fixture(""" assert context.get_tag_argument() == 'hi' """) command.upgrade(self.cfg, b, sql=True, tag='hi') command.downgrade(self.cfg, b, sql=True, tag='hi') def test_tag_pre_context_None(self): - _env_file_fixture(""" + env_file_fixture(""" assert context.get_tag_argument() is None """) command.upgrade(self.cfg, b, sql=True) command.downgrade(self.cfg, b, sql=True) def test_tag_cmd_arg(self): - _env_file_fixture(""" + env_file_fixture(""" context.configure(dialect_name='sqlite') assert context.get_tag_argument() == 'hi' """) @@ -119,7 +119,7 @@ assert context.get_tag_argument() == 'hi' command.downgrade(self.cfg, b, sql=True, tag='hi') def test_tag_cfg_arg(self): - _env_file_fixture(""" + env_file_fixture(""" context.configure(dialect_name='sqlite', tag='there') assert context.get_tag_argument() == 'there' """) @@ -127,7 +127,7 @@ assert context.get_tag_argument() == 'there' command.downgrade(self.cfg, b, sql=True, tag='hi') def test_tag_None(self): - _env_file_fixture(""" + env_file_fixture(""" context.configure(dialect_name='sqlite') assert context.get_tag_argument() is None """) |