Open PrestonHager opened 3 weeks ago
Current there are only 13 unit tests.
3 tests fail because they expect utility functions to raise an error when bad data is put in (this shouldn't happen in the modules code, I think?)
Another test fails because I'm not sure what the actual return value of session_key_to_path
is supposed to be since the _path
attribute wasn't in any of the session data when I ran the module's ingestor.
Suggestions for branch management with tests:
test
, dev
, or similar named branchmain
test
branch to the main
branchtest
branch from any other branchAdditionally, I didn't notice a linting file; should we also integrate pylint
or a similar library into the test suite?
Hello @PrestonHager, Thank you for this contribution!
When I run the tests locally, 4 of them (out of 9) are failing. Is it the same for you?
FAILED tests/unit/util/test_db.py::test_session_key_to_path - AssertionError: assert None == 'sessions/1'
FAILED tests/unit/util/test_misc.py::test_to_datetime - Failed: DID NOT RAISE <class 'ValueError'>
FAILED tests/unit/util/test_misc.py::test_to_timedelta - Failed: DID NOT RAISE <class 'ValueError'>
FAILED tests/unit/util/test_misc.py::test_add_timezone_info - AttributeError: 'int' object has no attribute 'replace'
Added tests using the
pytest
module. They can be run withpytest tests
in the root directory.Only unit tests for the utility files have been added. A fixture for mongodb is included.
This branch does include the
join_url
from theurl-fix
branch which means this should only get merged if #120 is merged. Other than that, the files in this branch have no operational impacts and are only used for development purposes. There are currently 13 total tests for three different utility files.Plans for the future:
requests
fixture for any web related data