adewes / blitzdb

Blitz is a document-oriented database for Python that is backend-agnostic. It comes with a flat-file database for JSON documents and provides MongoDB-like querying capabilities.
http://blitzdb.readthedocs.org
MIT License
330 stars 37 forks source link

Tests refactoring #28

Closed dmytrokyrychuk closed 10 years ago

dmytrokyrychuk commented 10 years ago

Fixes some problems described in #27.

$exists query operator works wrong. Seems like it always behave like in case when True is passed into it.

adewes commented 10 years ago

Thanks for the PR @orgkhnargh , the tests really needed some cleaning up! The build seems to be failing somehow with the new tests, can you check this? https://travis-ci.org/adewes/blitzdb/builds/37000994

I'll look into the issue with the $exists operator, maybe you have discovered another bug here.

dmytrokyrychuk commented 10 years ago

I rewrote test_exists function to expect $exists operator behave like mongodb's $exists. The build fails, because $exists operator does not work as expected. Check the test code here.

I had a quick look at the code that implements $exists operator. It does not perform any checks at all. It is just returns all the store keys it could find in the index. Check it here.

adewes commented 10 years ago

Thanks for pointing this out @orgkhnargh , I fixed the $exists implementation in the file backend and refactored the tests!