Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Commit

Permalink
Adding coverage configuration file.
Browse files Browse the repository at this point in the history
  • Loading branch information
rich-hart committed Feb 18, 2015
1 parent e113b6a commit 8bca86d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[run]
branch = True

[report]
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

raise NotImplementedError

ignore_errors = True

[html]
directory = coverage_html_report
5 changes: 4 additions & 1 deletion cnxauthoring/storage/postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ class PostgresqlStorage(BaseStorage):
Error = psycopg2.Error

def __init__(self, db_connection_string=None):
#initialize db
# initialize db
self.conn = psycopg2.connect(db_connection_string)
# adding a variable to store the db_connection string
# needed to restart the database when a connection
# is broken or lost.
self.db_connection_string = db_connection_string

def get(self, type_=Document, **kwargs):
Expand Down
4 changes: 4 additions & 0 deletions cnxauthoring/tests/test_storage/test_postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ def test_add_get_and_remove_binder(self):
{'user2': ('view',)})

def test_restart(self):
"""
Testing PostrgressStorage class restart function
with a password connection string.
"""
from ...storage.database import CONNECTION_SETTINGS_KEY
import psycopg2
settings = integration_test_settings()
Expand Down

0 comments on commit 8bca86d

Please sign in to comment.