Code Review
/
releng.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "dovetail: proposed_test run against apex"
[releng.git]
/
utils
/
test
/
testapi
/
opnfv_testapi
/
tests
/
unit
/
fake_pymongo.py
diff --git
a/utils/test/testapi/opnfv_testapi/tests/unit/fake_pymongo.py
b/utils/test/testapi/opnfv_testapi/tests/unit/fake_pymongo.py
index
adaf6f7
..
d95ff37
100644
(file)
--- a/
utils/test/testapi/opnfv_testapi/tests/unit/fake_pymongo.py
+++ b/
utils/test/testapi/opnfv_testapi/tests/unit/fake_pymongo.py
@@
-119,10
+119,14
@@
class MemDb(object):
@staticmethod
def _compare_date(spec, value):
@staticmethod
def _compare_date(spec, value):
+ gte = True
+ lt = False
for k, v in spec.iteritems():
for k, v in spec.iteritems():
- if k == '$gte' and value >= v:
- return True
- return False
+ if k == '$gte' and value < v:
+ gte = False
+ elif k == '$lt' and value < v:
+ lt = True
+ return gte and lt
def _in(self, content, *args):
if self.name == 'scenarios':
def _in(self, content, *args):
if self.name == 'scenarios':
@@
-185,9
+189,8
@@
class MemDb(object):
elif k == 'trust_indicator.current':
if content.get('trust_indicator').get('current') != v:
return False
elif k == 'trust_indicator.current':
if content.get('trust_indicator').get('current') != v:
return False
- elif content.get(k, None) != v:
+ elif
not isinstance(v, dict) and
content.get(k, None) != v:
return False
return False
-
return True
def _find(self, *args):
return True
def _find(self, *args):