Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

15 add tests #17

Merged
merged 12 commits into from
Dec 2, 2024
Merged

15 add tests #17

merged 12 commits into from
Dec 2, 2024

Conversation

sitzz
Copy link
Owner

@sitzz sitzz commented Nov 30, 2024

feat: added initial version of fake-couchbase

  • Create a fake Couchbase session
  • Perform insert, upsert, get, and remove actions on fake Couchbase class.

chore: updated package files

  • Renamed LICENSE.rst -> LICENSE
  • Renamed README.rst -> README.md
  • Updated setup.cfg, most importantly updating to correct license
    statement. Also added 'fake' as a package to indlude.
  • Added '__pycache__' to .gitignore. Can't fathom I hadn't already...

chore: added requirements files

Added requirements files for local development.

feat: added datetime utcnow hack

Supporting multiple Python versions due to the deprecation warning for datetime.datetime.utcnow() in a future release.

feat: added initial set of tests

Added tests for insert[_multi] and upsert[_multi] methods, as well as session validations.

feat: added tests for get methods

Added tests for get[_multi] methods.

chore: cleaned up unused globals in session test

Minor cleanup.

fix: fixed delay in couchbase_helper.fake.Cluster.wait_until_ready

The method couchbase_helper.fake.Cluster.wait_until_ready() was causing too long processing times which didn't mimic real world Couchbase time spent.

feat: added 'get_multi' to fake collection class

Added support for get_multi in the package's fake collection class.

feat: added proper return value in fake store class

The return value of couchbase_helper.fake.store._get() method was aligned with the Couchbase package's C-library response for get actions of it's kv_operation() function.

chore: undid making SessionProt runtime checkable for test purposes

Making couchbase_helper.protocols.SessionProt class runtime checkable wasn't really optimized, so this was undone. This was only done for tests anyway, so a "hack" was done in the tests.test_session.py instead which basically extends the SessionProt protocol and making that extended class runtime checkable instead. This should ensure performance isn't affected outside of the tests, which shouldn't matter for the primary use case of this package.

Limited scope

As issue #9 is due, tests for the couchbase_helper.helper.n1ql() method will not be included. Same is applicable for the couchbase_helper.helper.view_query() method even though no issue is open (yet) for its refinement/rewrite.
Hence both will not be part of this PR, it should be included as part of the PR when they are updated.

- Create a fake Couchbase session
- Perform insert, upsert, get, and remove actions on fake Couchbase
  class.
- Renamed LICENSE.rst -> LICENSE
- Renamed README.rst -> README.md
- Updated setup.cfg, most importantly updating to correct license
  statement. Also added 'fake' as a package to indlude.
- Added '__pycache__' to .gitignore. Can't fathom I hadn't already...
@sitzz sitzz linked an issue Nov 30, 2024 that may be closed by this pull request
@sitzz sitzz mentioned this pull request Dec 1, 2024
@sitzz sitzz added enhancement New feature or request wip Work in progress labels Dec 1, 2024
@sitzz sitzz removed the wip Work in progress label Dec 2, 2024
@sitzz sitzz merged commit ca0d26a into main Dec 2, 2024
@sitzz sitzz deleted the 15-add-tests branch December 2, 2024 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tests
1 participant