Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #55 from jehiah/travis-ci_55

Enable travis-ci
  • Loading branch information...
commit a9ede039772210c4d3221701c0d086629cd7d383 2 parents 6be100e + b6a25cf
@jehiah jehiah authored
View
12 .travis.yml
@@ -0,0 +1,12 @@
+language: python
+python:
+ - "2.5"
+ - "2.6"
+ - "2.7"
+services: mongodb
+install:
+ - "pip install tornado --use-mirrors"
+ - "pip install pymongo --use-mirrors"
+script: py.test
+notifications:
+ email: false
View
6 README.md
@@ -4,15 +4,13 @@ asyncmongo
AsyncMongo is an asynchronous library for accessing mongo
which is built on the tornado ioloop.
+[![Build Status](https://travis-ci.org/bitly/asyncmongo.png?branch=master)](https://travis-ci.org/bitly/asyncmongo)
+
Installation
------------
Installing: `pip install asyncmongo`
-Installing form github: `pip install git+https://github.com/bitly/asyncmongo.git`
-
-Installing from source: `git clone git://github.com/bitly/asyncmongo.git; cd asyncmongo; python setup.py install`
-
Usage
-----
View
4 asyncmongo/__init__.py
@@ -24,8 +24,8 @@
raise ImportError("bson library not installed. Install pymongo >= 1.9 https://github.com/mongodb/mongo-python-driver")
# also update in setup.py
-version = "1.2.1"
-version_info = (1, 2, 1)
+version = "1.2.2-alpha"
+version_info = (1, 2, 2)
ASCENDING = 1
"""Ascending sort order."""
View
2  setup.py
@@ -2,7 +2,7 @@
from distutils.core import setup
# also update version in __init__.py
-version = '1.2.1'
+version = '1.2.2-alpha'
setup(
name="asyncmongo",
View
4 test/test_authentication.py
@@ -12,13 +12,13 @@ class AuthenticationTest(test_shunt.MongoTest):
def setUp(self):
super(AuthenticationTest, self).setUp()
logging.info('creating user')
- pipe = subprocess.Popen('''echo -e 'use test;\n db.addUser("testuser", "testpass");\n exit;' | mongo --port 27017 --host 127.0.0.1''', shell=True)
+ pipe = subprocess.Popen('''echo -e 'use test;\n db.addUser("testuser", "testpass");\n exit;' | mongo --port 27018 --host 127.0.0.1''', shell=True)
pipe.wait()
def test_authentication(self):
try:
test_shunt.setup()
- db = asyncmongo.Client(pool_id='testauth', host='127.0.0.1', port=27017, dbname='test', dbuser='testuser', dbpass='testpass', maxconnections=2)
+ db = asyncmongo.Client(pool_id='testauth', host='127.0.0.1', port=27018, dbname='test', dbuser='testuser', dbpass='testpass', maxconnections=2)
def update_callback(response, error):
tornado.ioloop.IOLoop.instance().stop()
View
2  test/test_command.py
@@ -8,7 +8,7 @@ class CommandTest(
test_shunt.MongoTest,
test_shunt.SynchronousMongoTest,
):
- mongod_options = [('--port', '27017')]
+ mongod_options = [('--port', '27018')]
def setUp(self):
super(CommandTest, self).setUp()
View
6 test/test_connection.py
@@ -10,14 +10,14 @@
class ConnectionTest(test_shunt.MongoTest):
def test_getitem(self):
- db = asyncmongo.Client(pool_id='test_query', host='127.0.0.1', port=27017, dbname='test', mincached=3)
+ db = asyncmongo.Client(pool_id='test_query', host='127.0.0.1', port=27018, dbname='test', mincached=3)
self.assert_(
repr(db['foo']) == repr(db.foo),
"dict-style access of a collection should be same as property access"
)
def test_connection(self):
- db = asyncmongo.Client(pool_id='test_query', host='127.0.0.1', port=27017, dbname='test', mincached=3)
+ db = asyncmongo.Client(pool_id='test_query', host='127.0.0.1', port=27018, dbname='test', mincached=3)
for connection_name in [
'.',
'..',
@@ -35,7 +35,7 @@ def test_connection(self):
def test_query(self):
logging.info('in test_query')
test_shunt.setup()
- db = asyncmongo.Client(pool_id='test_query', host='127.0.0.1', port=27017, dbname='test', mincached=3)
+ db = asyncmongo.Client(pool_id='test_query', host='127.0.0.1', port=27018, dbname='test', mincached=3)
def insert_callback(response, error):
tornado.ioloop.IOLoop.instance().stop()
View
2  test/test_duplicate_insert.py
@@ -10,7 +10,7 @@
class DuplicateInsertTest(test_shunt.MongoTest):
def test_duplicate_insert(self):
test_shunt.setup()
- db = asyncmongo.Client(pool_id='dup_insert', host='127.0.0.1', port=27017, dbname='test')
+ db = asyncmongo.Client(pool_id='dup_insert', host='127.0.0.1', port=27018, dbname='test')
def insert_callback(response, error):
tornado.ioloop.IOLoop.instance().stop()
View
2  test/test_insert_delete.py
@@ -10,7 +10,7 @@
class InsertDeleteTest(test_shunt.MongoTest):
def test_insert(self):
test_shunt.setup()
- db = asyncmongo.Client(pool_id='testinsert', host='127.0.0.1', port=27017, dbname='test')
+ db = asyncmongo.Client(pool_id='testinsert', host='127.0.0.1', port=27018, dbname='test')
def insert_callback(response, error):
tornado.ioloop.IOLoop.instance().stop()
View
4 test/test_pooled_db.py
@@ -15,7 +15,7 @@ def test_pooled_db(self):
"""
print asyncmongo.__file__
test_shunt.setup()
- client = asyncmongo.Client('id1', maxconnections=5, host='127.0.0.1', port=27017, dbname='test')
+ client = asyncmongo.Client('id1', maxconnections=5, host='127.0.0.1', port=27018, dbname='test')
test_users_collection = client.connection('test_users')
def insert_callback(response, error):
@@ -51,7 +51,7 @@ def pool_callback2(response, error):
def too_many_connections(self):
clients = [
- asyncmongo.Client('id2', maxconnections=2, host='127.0.0.1', port=27017, dbname='test')
+ asyncmongo.Client('id2', maxconnections=2, host='127.0.0.1', port=27018, dbname='test')
for i in range(3)
]
View
2  test/test_query.py
@@ -7,7 +7,7 @@
class QueryTest(test_shunt.MongoTest, test_shunt.SynchronousMongoTest):
- mongod_options = [('--port', '27017')]
+ mongod_options = [('--port', '27018')]
def setUp(self):
super(QueryTest, self).setUp()
View
2  test/test_safe_updates.py
@@ -10,7 +10,7 @@
class SafeUpdatesTest(test_shunt.MongoTest):
def test_update_safe(self):
test_shunt.setup()
- db = asyncmongo.Client(pool_id='testinsert', host='127.0.0.1', port=27017, dbname='test', maxconnections=2)
+ db = asyncmongo.Client(pool_id='testinsert', host='127.0.0.1', port=27018, dbname='test', maxconnections=2)
def update_callback(response, error):
tornado.ioloop.IOLoop.instance().stop()
View
6 test/test_shunt.py
@@ -39,7 +39,7 @@ class MongoTest(unittest.TestCase):
"""
Starts and stops a mongod
"""
- mongod_options = [('--port', str(27017))]
+ mongod_options = [('--port', str(27018))]
def setUp(self):
"""setup method that starts up mongod instances using `self.mongo_options`"""
# So any function that calls IOLoop.instance() gets the
@@ -62,7 +62,7 @@ def setUp(self):
self.temp_dirs.append(dirname)
options = ['mongod', '--bind_ip', '127.0.0.1', '--oplogSize', '10',
- '--dbpath', dirname, '--smallfiles', '-v'] + list(options)
+ '--dbpath', dirname, '--smallfiles', '-v', '--nojournal'] + list(options)
logging.debug(options)
pipe = subprocess.Popen(options)
self.mongods.append(pipe)
@@ -90,7 +90,7 @@ class SynchronousMongoTest(unittest.TestCase):
Convenience class: a test case that can make synchronous calls to the
official pymongo to ease setup code, via the pymongo_conn property.
"""
- mongod_options = [('--port', str(27017))]
+ mongod_options = [('--port', str(27018))]
@property
def pymongo_conn(self):
if not hasattr(self, '_pymongo_conn'):
View
8 test/test_slave_only.py
@@ -9,14 +9,14 @@
class SlaveOnlyTest(test_shunt.MongoTest):
mongod_options = [
- ('--port', '27017', '--master'),
- ('--port', '27018', '--slave', '--source', '127.0.0.1:27017'),
+ ('--port', '27018', '--master'),
+ ('--port', '27019', '--slave', '--source', '127.0.0.1:27018'),
]
def test_query_slave(self):
try:
test_shunt.setup()
- masterdb = asyncmongo.Client(pool_id='testquerymaster', host='127.0.0.1', port=27017, dbname='test', maxconnections=2)
- slavedb = asyncmongo.Client(pool_id='testqueryslave', host='127.0.0.1', port=27018, dbname='test', maxconnections=2, slave_okay=True)
+ masterdb = asyncmongo.Client(pool_id='testquerymaster', host='127.0.0.1', port=27018, dbname='test', maxconnections=2)
+ slavedb = asyncmongo.Client(pool_id='testqueryslave', host='127.0.0.1', port=27019, dbname='test', maxconnections=2, slave_okay=True)
logging.debug('waiting for replication to start (sleeping 4 seconds)')
time.sleep(4)
View
2  test/testgtk2/test.py
@@ -7,7 +7,7 @@
import gtk
import asyncmongo
-database= {'host' : '127.0.0.1', 'port' : 27017, 'dbname' : 'testdb', 'maxconnections':5}
+database= {'host' : '127.0.0.1', 'port' : 27018, 'dbname' : 'testdb', 'maxconnections':5}
class TestApp(object):
def __init__(self):
View
2  test/testgtk3/test.py
@@ -5,7 +5,7 @@
import asyncmongo
from gi.repository import Gtk
-database= {'host' : '127.0.0.1', 'port' : 27017, 'dbname' : 'testdb', 'maxconnections':5}
+database= {'host' : '127.0.0.1', 'port' : 27018, 'dbname' : 'testdb', 'maxconnections':5}
class TestApp(object):
def __init__(self):
Please sign in to comment.
Something went wrong with that request. Please try again.