Skip to content

Commit

Permalink
Add CLI init test case for multiple contexts
Browse files Browse the repository at this point in the history
Close #28
  • Loading branch information
karenc committed Mar 31, 2016
1 parent f5409cd commit 8ed1530
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions dbmigrator/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,23 @@ def test(self):
20160228212456_cool_stuff False \
\n""", stdout)
self.assertEqual('', stderr)


class InitTestCase(BaseTestCase):
def test_multiple_contexts(self):
from ..cli import main

testing.install_test_packages()

cmd = ['--db-connection-string', testing.db_connection_string]
main(cmd + ['--context', 'package-a', '--context', 'package-b',
'init'])

with testing.captured_output() as (out, err):
main(cmd + ['--context', 'package-a', '--context', 'package-b',
'list'])

stdout = out.getvalue()
self.assertIn('20160228202637_add_table True', stdout)
self.assertIn('20160228210326_initial_da True', stdout)
self.assertIn('20160228212456_cool_stuff True', stdout)

0 comments on commit 8ed1530

Please sign in to comment.