http://hg.code.sf.net:8000/p/roundup/code/atom-log/tip/roundup/test/memorydb.py Mercurial Repository: p/roundup/code: roundup/test/memorydb.py history 2025-01-04T22:34:47-05:00 chore(ruff): variable renames, formatting, sort imports, use with open http://hg.code.sf.net:8000/p/roundup/code/#changeset-617d85ce4ac3e57b5b13cff764bb1d024e7db99e John Rouillard rouilj@ieee.org 2025-01-04T22:34:47-05:00 2025-01-04T22:34:47-05:00
changeset 617d85ce4ac3
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description chore(ruff): variable renames, formatting, sort imports, use with open
files
Add config argument to more password.Password invocations. http://hg.code.sf.net:8000/p/roundup/code/#changeset-506c86823abbdeb0aae419b9197e0c200c020a9e John Rouillard rouilj@ieee.org 2023-03-04T00:17:26-05:00 2023-03-04T00:17:26-05:00
changeset 506c86823abb
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Add config argument to more password.Password invocations.

The work done to allow password_pbkdf2_default_rounds to be overridden
for testing requires that calls to password.Password include a config
argument.

This was needed because using the real value more than quadrupled
testing runtime.

However there are still a few places where config was not being set
when Password was called. I think this fixes all of the ones that are
called from a function that have access to a db.config object.

The remaining ones all call Password(encrypted=x). This results in
Password.unpack() being called. If x is not a propertly formatted
password string ("{scheme}...", it calls encodePassword. It then
should end up raising the ConfigNotSet exception. This is
probably what we want as it means the shape of "x" is not correct.

I don't understand why Password.unpack() attempts to encrypt the value
of encrypted if it doesn't match the right form. According to codecov,
this encryption branch is being used, so somewhere x is of the wrong
form. Hmmm....
files
flake8 fixes http://hg.code.sf.net:8000/p/roundup/code/#changeset-b1130680d4ede09301c5ee26b90b32fc28840e81 John Rouillard rouilj@ieee.org 2022-09-08T14:06:22-04:00 2022-09-08T14:06:22-04:00
changeset b1130680d4ed
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description flake8 fixes
files
Implement UpdateTimestamp for memorydb and test. http://hg.code.sf.net:8000/p/roundup/code/#changeset-2ce8558036333fd7c881e681af4153ea451449ff John Rouillard rouilj@ieee.org 2022-08-07T10:03:27-04:00 2022-08-07T10:03:27-04:00
changeset 2ce855803633
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Implement UpdateTimestamp for memorydb and test.

Also test proper DbType when running memory test.
files
memorydb fixes for otks tests. http://hg.code.sf.net:8000/p/roundup/code/#changeset-5053ee6c846baa88d0f2032f4c7a9046914e2106 John Rouillard rouilj@ieee.org 2022-08-07T01:26:30-04:00 2022-08-07T01:26:30-04:00
changeset 5053ee6c846b
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description memorydb fixes for otks tests.

in test setup otks was not set. Also fixed import from dbm used by
memorydb OneTimeKeys to inherit from OneTimeKeys rather than Sessions.
files
implement default argument return in BasicDatabase.get() http://hg.code.sf.net:8000/p/roundup/code/#changeset-a4652d809ec514170e3c0108f29a43cfcc78306b John Rouillard rouilj@ieee.org 2022-08-04T15:49:01-04:00 2022-08-04T15:49:01-04:00
changeset a4652d809ec5
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description implement default argument return in BasicDatabase.get()
files
Add tests to BasicDatabase and merge implementations http://hg.code.sf.net:8000/p/roundup/code/#changeset-375d40a9e730ee2cfbb5f3fa5760dce93bdad63c John Rouillard rouilj@ieee.org 2022-07-25T21:21:26-04:00 2022-07-25T21:21:26-04:00
changeset 375d40a9e730
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Add tests to BasicDatabase and merge implementations

test/session_common.py:

add new tests:

* test set with bad __timestamps
* test get on missing item with no default
* test clear() method
* test new lifetime() method

everything below here was needed to get the tests to work across all
db's.

roundup/backends/sessions_dbm.py:

make set() validate __timestamp as float. If invalid and item is new,
set it to time.time(). If invalid and item exists keep original
timestamp.

add lifetime(key_lifetime) method. Given key_lifetime in seconds,
generate a __timestamp that will be deleted after that many seconds.

roundup/backends/sessions_rdbms.py:

make set() behave the same as session_dbm.

add lifetime method as above.

roundup/backends/sessions_sqlite.py:

import session_rdbms::BasicDatabase and override __init__.
rather than cloning all the code. Kept a few logging and sql methods.

roundup/test/memorydb.py:

make get() on a missing key return KeyError
make set() conform to dbm/rdbms implementations.
files
Add i18n object to roundupdb.Database http://hg.code.sf.net:8000/p/roundup/code/#changeset-408fd477761fa40fd7dfa13c4a25be572cd46dd9 Ralf Schlatterbeck rsc@runtux.com 2022-05-03T14:51:59+02:00 2022-05-03T14:51:59+02:00
changeset 408fd477761f
branch
bookmark
tag
user Ralf Schlatterbeck <rsc@runtux.com>
description Add i18n object to roundupdb.Database

This makes the i18n object accessible everywhere (including in detectors
where localized error messages were impossible). See issue2551184
files
Actually call close(). http://hg.code.sf.net:8000/p/roundup/code/#changeset-a7072cf4ad7e1f8c4d7ce628f0a82f543d128c56 John Rouillard rouilj@ieee.org 2021-09-06T16:35:22-04:00 2021-09-06T16:35:22-04:00
changeset a7072cf4ad7e
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Actually call close().
files
Fix more opens that aren't closed. http://hg.code.sf.net:8000/p/roundup/code/#changeset-4351c95faace7599b35214fa72ee771a500604e0 John Rouillard rouilj@ieee.org 2021-09-06T16:23:48-04:00 2021-09-06T16:23:48-04:00
changeset 4351c95faace
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Fix more opens that aren't closed.
files
Handle more ResourceWarning issues. http://hg.code.sf.net:8000/p/roundup/code/#changeset-087cae2fbceac66f1fab1090fd02556033506a01 John Rouillard rouilj@ieee.org 2021-09-06T16:03:31-04:00 2021-09-06T16:03:31-04:00
changeset 087cae2fbcea
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Handle more ResourceWarning issues.

admin.py - remove unneeded close.
mailer.py - close debug log file.
indexer.py - close read of version file
memorydb.py - close python files being compled. Similiar to instance.
not sure why it's compoing things and not just letting instance do
it.
.travis.ymv disable all except 3.9-dev till we get a handle on errors.
also increase errors to 50 from 20.
files
Make memorydb persistent across re-open http://hg.code.sf.net:8000/p/roundup/code/#changeset-7f00fc5958cad7db10bae202b8a22214584fc076 Ralf Schlatterbeck rsc@runtux.com 2021-03-31T12:49:28+02:00 2021-03-31T12:49:28+02:00
changeset 7f00fc5958ca
branch
bookmark
tag
user Ralf Schlatterbeck <rsc@runtux.com>
description Make memorydb persistent across re-open

This allows memorydb to be used for more tests, in particular re-opening
with another user for checking permissions.
files
Fix roundup/test http://hg.code.sf.net:8000/p/roundup/code/#changeset-58817c3bf47111b723b3fca5ef988f5ba9a54f8a Ralf Schlatterbeck rsc@runtux.com 2021-03-30T14:16:28+02:00 2021-03-30T14:16:28+02:00
changeset 58817c3bf471
branch
bookmark
tag
user Ralf Schlatterbeck <rsc@runtux.com>
description Fix roundup/test

Move the test-detectors in tx_Source_detector.py to roundup/test for two
reasons: It's used in the memorydb convenience functions and it may be
useful in other tests. Make the prefix a paramter of the convenience
functions to be usable in other tests.
files
Move memorydb from test to roundup/test http://hg.code.sf.net:8000/p/roundup/code/#changeset-a77a7d04ed23165ce61ab5097f2f658613344c70 Ralf Schlatterbeck rsc@runtux.com 2021-03-30T09:10:46+02:00 2021-03-30T09:10:46+02:00
changeset a77a7d04ed23
branch
bookmark
tag
user Ralf Schlatterbeck <rsc@runtux.com>
description Move memorydb from test to roundup/test

.. to allow regression-testing in tracker instances without copying code.
files