1
0
mirror of https://github.com/bspeice/metrik synced 2025-07-03 06:45:07 -04:00

Get some tests in place for the MongoDB stuff

This commit is contained in:
Bradlee Speice
2016-08-16 17:21:09 -04:00
parent 4c1ab63118
commit 982b9dcb47
6 changed files with 82 additions and 4 deletions

View File

@ -1,4 +1,16 @@
import os
import sys
IS_TRAVIS = 'TRAVIS_BUILD_NUMBER' in os.environ
IS_PYTEST = hasattr(sys, '_called_from_test')
TEST = IS_PYTEST or IS_TRAVIS
USER_AGENT = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
MONGO_HOST = 'localhost'
MONGO_PORT = 27017
MONGO_DATABASE = 'metrik'
if TEST:
MONGO_DATABASE = 'metrik'
else:
MONGO_DATABASE = 'metrik-test'

View File

@ -19,7 +19,6 @@ class MongoTarget(Target):
def persist(self, dict_object):
id_dict = dict_object
id_dict['_id'] = self.id
id_dict['_retrieved'] = datetime.now()
return self.collection.insert_one(id_dict).inserted_id
def retrieve(self):