Skip to content

Commit

Permalink
Extend docstrings for autodocs
Browse files Browse the repository at this point in the history
  • Loading branch information
lnksz committed Oct 1, 2017
1 parent 1962f58 commit 12a4819
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 4 deletions.
18 changes: 17 additions & 1 deletion rivus/tests/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,26 @@ class RivusDBTest(unittest.TestCase):

def test_df_insert_query(self):
"""Are the stored dataframes and the retrieved ones identical?
- Comparison form is *after* create_model. (index is set)
- Comparison form of frames is *after* create_model. (index is set)
- Comparison form expects that input dataframes only have meaningful
columns. (See pull request #23)
- Only implemented dataframes are tested.
Note
----
Requires a ``config.json`` file in the root of rivus-repo with the
database credentials. For Example:
::
{
"db" : {
"user" : "postgres",
"pass" : "postgres",
"host" : "localhost",
"base" : "rivus"
}
}
"""
conf_path = os.path.join(pdir(pdir(pdir(__file__))), 'config.json')
config = []
Expand Down
2 changes: 1 addition & 1 deletion rivus/tests/test_gridder.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from rivus.main.rivus import read_excel


class RivusTest(unittest.TestCase):
class RivusGridTest(unittest.TestCase):

# TODO There is plenty of more functions (if not all)
# which reside in the code-base untested. Bellow some placeholders.
Expand Down
2 changes: 1 addition & 1 deletion rivus/tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from rivus.main.rivus import read_excel


class RivusTest(unittest.TestCase):
class RivusMainTest(unittest.TestCase):

# TODO There is plenty of more functions (if not all)
# which reside in the code-base untested. Bellow some placeholders.
Expand Down
29 changes: 28 additions & 1 deletion rivus/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@
import json


class RivusTest(unittest.TestCase):
class RivusUtilsTest(unittest.TestCase):

def test_parameter_range(self):
"""Load minimal example data and test with one of the parameters
+ Tests for side-effects on the original.
+ Tests for the awaited numer of parameters.
+ Tests for range of the parameters
"""
proj_name = 'mnl'
base_directory = os.path.join('data', proj_name)
data_spreadsheet = os.path.join(base_directory, 'data.xlsx')
Expand Down Expand Up @@ -44,6 +50,27 @@ def test_parameter_range(self):
msg='Got parameter smaller than awaited.')

def test_email_notification(self):
"""It only can test, whether the notification function run trhrough
successfully.
Can be useful for quick testing the email parameters in the config file
Note
-----
Requires a ``config.json`` file in the root of rivus-repo with the
database credentials. For Example:
::
{
"email" : {
"s_user" : "[email protected]",
"s_pass" : "TheAnswerIs42!",
"r_user" : "[email protected]",
"smpt_addr" : "smtp.gmail.com",
"smpt_port" : "587"
}
}
"""
# Concatenate the absolute path to the config file.
# conf_path = __file__[:-len('rivus/tests/utils.py')] + 'config.json'
conf_path = os.path.join(pdir(pdir(pdir(__file__))), 'config.json')
Expand Down

0 comments on commit 12a4819

Please sign in to comment.