Skip to content

Commit

Permalink
version 2.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
lvieirajr committed Dec 22, 2015
1 parent c8911e1 commit f3e4a0b
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion mongorest/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- encoding: UTF-8 -*-
from __future__ import absolute_import, unicode_literals

__version__ = '2.5.3'
__version__ = '2.5.4'
3 changes: 2 additions & 1 deletion mongorest/database.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- encoding: UTF-8 -*-
from __future__ import absolute_import, unicode_literals

from mongo_proxy import MongoProxy
from pymongo import MongoClient
from pymongo.uri_parser import parse_uri

Expand Down Expand Up @@ -40,7 +41,7 @@ def _get_db():
if 'OPTIONS' in mongo and mongo['OPTIONS']:
uri += '?{0}'.format('&'.join(mongo['OPTIONS']))

return MongoClient(uri)[parse_uri(uri)['database']]
return MongoProxy(MongoClient(uri)[parse_uri(uri)['database']])


db = _get_db()
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-e git://github.com/arngarden/MongoDBProxy.git#egg=MongoDBProxy
pymongo==3.0.3
six==1.9.0
werkzeug==0.10.4
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def run_tests(self):
url='https://github.com/lvieirajr/mongorest',
download_url='github.com/lvieirajr/mongorest/tarball/{0}'.format(version),
install_requires=['pymongo', 'werkzeug', 'six'],
dependency_links=['https://github.com/arngarden/MongoDBProxy/tarball/master#egg=MongoDBProxy'],
cmdclass={'test': Test},
keywords=['mongodb', 'mongo', 'rest', 'api', 'pymongo', 'werkzeug'],
classifiers=[
Expand Down
2 changes: 1 addition & 1 deletion tests/test_collection/test_collection_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
class TestCollectionMeta(TestCase):

def test_collection_meta_sets_correct_collection_and_meta(self):
self.assertEqual(Collection.collection, self.db['collection'])
self.assertEqual(Collection.collection.name, self.db['collection'].name)
self.assertEqual(Collection.meta, {'required': {}, 'optional': {}})
3 changes: 2 additions & 1 deletion tests/test_database/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from __future__ import absolute_import, unicode_literals

from os import environ
from mongo_proxy import MongoProxy
from pymongo.database import Database

from mongorest.database import db, _get_db
Expand All @@ -11,7 +12,7 @@
class TestDatabase(TestCase):

def test_db_is_a_pymongo_database(self):
self.assertIsInstance(db, Database)
self.assertIsInstance(db, MongoProxy)

def test_db_connected_to_correct_database(self):
self.assertEqual(db.name, 'mongorest')
Expand Down
3 changes: 2 additions & 1 deletion tests/test_testcase/test_testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from logging import getLogger, CRITICAL

from mongo_proxy import MongoProxy
from pymongo.database import Database
from werkzeug.test import Client

Expand All @@ -15,7 +16,7 @@ def setUp(self):
self.test_case = TestCase(methodName='__call__')

def test_testcase_has_instance_of_pymongos_database(self):
self.assertIsInstance(self.test_case.db, Database)
self.assertIsInstance(self.test_case.db, MongoProxy)

def test_testcase_has_werkzeugs_test_client(self):
self.assertEqual(self.test_case.client, Client)
Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ setenv =
PYTHONPATH={toxinidir}
commands =
coverage run --source=mongorest setup.py test
coveralls

0 comments on commit f3e4a0b

Please sign in to comment.