##// END OF EJS Templates
add sugar methods/properties to AsyncResult...
add sugar methods/properties to AsyncResult * ar.wall_time = received - submitted * ar.serial_time = sum of serial computation time * ar.elapsed = time since submission (wall_time if done) * ar.progress = (int) number of sub-tasks that have completed * ar.wait_interactive(): prints progress * len(ar) = # of tasks

File last commit:

r4018:9950e71b
r6462:148c7756
Show More
test_mongodb.py
42 lines | 1.1 KiB | text/x-python | PythonLexer
"""Tests for mongodb backend
Authors:
* Min RK
"""
#-------------------------------------------------------------------------------
# Copyright (C) 2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Imports
#-------------------------------------------------------------------------------
from nose import SkipTest
from pymongo import Connection
from IPython.parallel.controller.mongodb import MongoDB
from . import test_db
try:
c = Connection()
except Exception:
c=None
class TestMongoBackend(test_db.TestDictBackend):
"""MongoDB backend tests"""
def create_db(self):
try:
return MongoDB(database='iptestdb', _connection=c)
except Exception:
raise SkipTest("Couldn't connect to mongodb")
def teardown(self):
if c is not None:
c.drop_database('iptestdb')