Skip to content

Instantly share code, notes, and snippets.

@x10an14
Last active March 16, 2018 21:03
Show Gist options
  • Save x10an14/7b9b974a005a10a2f5826c4bfe090c89 to your computer and use it in GitHub Desktop.
Save x10an14/7b9b974a005a10a2f5826c4bfe090c89 to your computer and use it in GitHub Desktop.
[2018.03.16T22:02:22CET] x10an14@x10-P65xRP ~/overtime-calculator (minor_changes *% u= origin/minor_changes) $ pipenv run python -m coverage run -m py.test -v
==================================================================================================================== test session starts =====================================================================================================================
platform linux -- Python 3.6.3, pytest-3.4.2, py-1.5.2, pluggy-0.6.0 -- /home/x10an14/.local/share/virtualenvs/overtime-calculator-Z0nwGDbO/bin/python
cachedir: .pytest_cache
rootdir: /home/x10an14/Documents/github/overtime-calculator, inifile: setup.cfg
plugins: hypothesis-3.49.1
collected 7 items
overtime_calculator/tests/auth_test.py::test_register FAILED [ 14%]
overtime_calculator/tests/auth_test.py::test_signin FAILED [ 28%]
overtime_calculator/tests/csv_utils_test.py::test_valid_csv_files_parsing[header_and_five_rows.csv-expected0] PASSED [ 42%]
overtime_calculator/tests/csv_utils_test.py::test_valid_csv_files_parsing[header_and_one_row.csv-expected1] PASSED [ 57%]
overtime_calculator/tests/csv_utils_test.py::test_empty_csv_file_parsing[empty_file.csv] PASSED [ 71%]
overtime_calculator/tests/csv_utils_test.py::test_no_header_csv_file_parsing[three_rows_no_header.csv] PASSED [ 85%]
overtime_calculator/tests/csv_utils_test.py::test_header_only_csv_file_parsing[header_only.csv] PASSED [100%]
========================================================================================================================== FAILURES ==========================================================================================================================
_______________________________________________________________________________________________________________________ test_register ________________________________________________________________________________________________________________________
def test_register():
response = hug.test.post(api, '/register', {'username': 'test_1', 'password': 'test_1'})
> assert response.data == {'status': 'ok'}
E AssertionError: assert {'error': 'us...ready in use'} == {'status': 'ok'}
E Left contains more items:
E {'error': 'username already in use'}
E Right contains more items:
E {'status': 'ok'}
E Full diff:
E - {'error': 'username already in use'}
E + {'status': 'ok'}
overtime_calculator/tests/auth_test.py:11: AssertionError
________________________________________________________________________________________________________________________ test_signin _________________________________________________________________________________________________________________________
def test_signin():
> response = hug.test.post(api, '/signin', {'username': 'test_1', 'password': 'test_1'})
overtime_calculator/tests/auth_test.py:14:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../.local/share/virtualenvs/overtime-calculator-Z0nwGDbO/lib/python3.6/site-packages/hug/test.py:51: in call
body=body, scheme=scheme), response)
../../../.local/share/virtualenvs/overtime-calculator-Z0nwGDbO/lib/python3.6/site-packages/falcon/api.py:244: in __call__
responder(req, resp, **params)
../../../.local/share/virtualenvs/overtime-calculator-Z0nwGDbO/lib/python3.6/site-packages/hug/interface.py:734: in __call__
raise exception
../../../.local/share/virtualenvs/overtime-calculator-Z0nwGDbO/lib/python3.6/site-packages/hug/interface.py:709: in __call__
self.render_content(self.call_function(input_parameters), request, response, **kwargs)
../../../.local/share/virtualenvs/overtime-calculator-Z0nwGDbO/lib/python3.6/site-packages/hug/interface.py:649: in call_function
return self.interface(**parameters)
../../../.local/share/virtualenvs/overtime-calculator-Z0nwGDbO/lib/python3.6/site-packages/hug/interface.py:100: in __call__
return __hug_internal_self._function(*args, **kwargs)
overtime_calculator/src/auth.py:45: in signin_user
with user_pw_file.open() as f:
/usr/lib/python3.6/pathlib.py:1161: in open
opener=self._opener)
/usr/lib/python3.6/pathlib.py:1015: in _opener
return self._accessor.open(self, flags, mode)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pathobj = PosixPath('data/users/test_1/password.txt'), args = (524288, 438)
@functools.wraps(strfunc)
def wrapped(pathobj, *args):
> return strfunc(str(pathobj), *args)
E FileNotFoundError: [Errno 2] No such file or directory: 'data/users/test_1/password.txt'
/usr/lib/python3.6/pathlib.py:387: FileNotFoundError
============================================================================================================= 2 failed, 5 passed in 0.61 seconds =============================================================================================================
[2018.03.16T22:02:58CET] x10an14@x10-P65xRP ~/overtime-calculator (minor_changes *% u= origin/minor_changes) $
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment