##// END OF EJS Templates
various db backend fixes...
various db backend fixes * use index on msg_id in mongodb backend (_table prevented some methods from working outside the session) * purge_request improved to use fewer db calls * mongodb testcase split into its own file * Fix equality testing, NULL handling, in SQLiteDB backend

File last commit:

r3875:ffe043d4
r3875:ffe043d4
Show More
test_mongodb.py
37 lines | 1.1 KiB | text/x-python | PythonLexer
"""Tests for mongodb backend"""
#-------------------------------------------------------------------------------
# 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')