Skip to content

Commit

Permalink
add test for existing table
Browse files Browse the repository at this point in the history
  • Loading branch information
snopoke committed May 8, 2018
1 parent 1f10dda commit 6cd13c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
logging.getLogger().setLevel(logging.DEBUG)
logging.getLogger().addHandler(logging.StreamHandler())


@pytest.fixture(scope="class", params=[
{
'url': "postgresql://postgres@/%s",
'url': "postgresql://postgres@localhost/%s",
'admin_db': 'postgres'
},
{
Expand Down
6 changes: 6 additions & 0 deletions tests/test_checkpointmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ def test_create_checkpoint_table(self, manager):
with manager:
assert 'commcare_export_runs' in manager.metadata.tables

def test_checkpoint_table_exists(self, manager):
self.test_create_checkpoint_table(manager)
with manager:
manager.connection.execute(manager.sqlalchemy.sql.text('DROP TABLE alembic_version'))
manager.create_checkpoint_table()

def test_get_time_of_last_run(self, manager):
manager.create_checkpoint_table()
with manager:
Expand Down

0 comments on commit 6cd13c9

Please sign in to comment.