Permalink
Browse files

Replace use of replicaSet with replica_set

Version 0.2 of Simon switched the preferred name of the replica set argument when calling the `connect()` method.  This updates the one reference to `connect()` to use `replica_set` instead of `replicaSet`. It also updates the tests and sets the minimum version of Simon to 0.2.

While this version of Simon includes a change that isn't backwards compatible, Simon isn't considered production-ready yet, so I feel comfortable making the change.
  • Loading branch information...
1 parent 16b5cf9 commit 9d5a42e5577d55640b8176aef680a13d84a10eec @dirn committed Feb 4, 2013
Showing with 9 additions and 9 deletions.
  1. +1 −1 flask_simon/__init__.py
  2. +1 −1 setup.py
  3. +7 −7 tests/test_simon.py
@@ -104,7 +104,7 @@ def prefixed(name):
host = '{0}:{1}'.format(host, port)
connection.connect(host, name=name, alias=alias, username=username,
- password=password, replicaSet=replica_set)
+ password=password, replica_set=replica_set)
def get_or_404(model, *qs, **fields):
View
@@ -20,7 +20,7 @@
packages=['flask_simon'],
package_data={'': ['LICENSE', 'README.rst']},
include_package_data=True,
- install_requires=['flask>=0.8', 'pymongo>=2.1', 'simon'],
+ install_requires=['flask>=0.8', 'pymongo>=2.1', 'simon>=0.2'],
tests_require=['coverage', 'mock', 'nose'],
license=open('LICENSE').read(),
classifiers=(
View
@@ -48,13 +48,13 @@ def test_init_app(self):
connect.assert_called_with('localhost:27017', name='test',
alias=None, username=None,
- password=None, replicaSet=None)
+ password=None, replica_set=None)
simon.init_app(self.app, prefix='SIMON', alias='simon')
connect.assert_called_with('localhost:27017', name='test',
alias='simon', username=None,
- password=None, replicaSet=None)
+ password=None, replica_set=None)
def test_init_app_invaliduri(self):
"""Test that `init_app()` raises `InvalidURI`."""
@@ -80,13 +80,13 @@ def test_init_app_multiple_connections(self):
connect.assert_called_with(url1, name='simon', alias=None,
username='simonu', password='simonp',
- replicaSet=None)
+ replica_set=None)
simon.init_app(self.app, prefix='SIMON')
connect.assert_called_with(url2, name='test', alias=None,
username='simonu', password='simonp',
- replicaSet=None)
+ replica_set=None)
def test_init_app_prefix(self):
"""Test the `init_app()` method with a different prefix."""
@@ -100,7 +100,7 @@ def test_init_app_prefix(self):
connect.assert_called_with(url, name='test-simon', alias=None,
username='simonu', password='simonp',
- replicaSet=None)
+ replica_set=None)
def test_init_app_settings(self):
"""Test the `init_app()` method with config settings."""
@@ -115,7 +115,7 @@ def test_init_app_settings(self):
connect.assert_called_with('localhost:27017', name='test-simon',
alias=None, username=None,
- password=None, replicaSet=None)
+ password=None, replica_set=None)
def test_init_app_uri(self):
"""Test the `init_app()` method with `MONGO_URI`."""
@@ -130,7 +130,7 @@ def test_init_app_uri(self):
connect.assert_called_with(url, name='test-simon', alias=None,
username='simonu', password='simonp',
- replicaSet='rs-simon')
+ replica_set='rs-simon')
def test_init_app_valueerror(self):
"""Test that `init_app()` raises `ValueError`."""

0 comments on commit 9d5a42e

Please sign in to comment.