diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-01-20 16:23:20 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-01-20 16:23:20 -0500 |
commit | 38368e8f9a306ba9dfa668dcc8cfaef5d2f031b1 (patch) | |
tree | 7bb9cc3b4d2912e1c821076dbfe14025787d48c7 /tests/test_config.py | |
parent | a1feddafbd9806988ecc5c266d8a8fdb9f0d985d (diff) | |
download | alembic-38368e8f9a306ba9dfa668dcc8cfaef5d2f031b1.tar.gz |
- [feature] Can create alembic.config.Config
with no filename, use set_main_option()
to add values. Also added set_section_option()
which will add sections. [#23]
Diffstat (limited to 'tests/test_config.py')
-rw-r--r-- | tests/test_config.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_config.py b/tests/test_config.py new file mode 100644 index 0000000..fb54e8a --- /dev/null +++ b/tests/test_config.py @@ -0,0 +1,18 @@ +from alembic import config +from tests import eq_ + +def test_config_no_file_main_option(): + cfg = config.Config() + cfg.set_main_option("url", "postgresql://foo/bar") + + eq_(cfg.get_main_option("url"), "postgresql://foo/bar") + + +def test_config_no_file_section_option(): + cfg = config.Config() + cfg.set_section_option("foo", "url", "postgresql://foo/bar") + + eq_(cfg.get_section_option("foo", "url"), "postgresql://foo/bar") + + cfg.set_section_option("foo", "echo", "True") + eq_(cfg.get_section_option("foo", "echo"), "True")
\ No newline at end of file |