Files
deb-python-cassandra-driver/cqlengine/tests/base.py
Blake Eggleston 2db6426d02 added fault tolerant connection manager, which will be easily extended to support connection pooling
added support for multiple connections
removed dependence on setting keyspace name on opening connection
2012-11-24 23:11:09 -08:00

19 lines
591 B
Python

from unittest import TestCase
from cqlengine import connection
class BaseCassEngTestCase(TestCase):
@classmethod
def setUpClass(cls):
super(BaseCassEngTestCase, cls).setUpClass()
if not connection._hosts:
connection.setup(['localhost'])
def assertHasAttr(self, obj, attr):
self.assertTrue(hasattr(obj, attr),
"{} doesn't have attribute: {}".format(obj, attr))
def assertNotHasAttr(self, obj, attr):
self.assertFalse(hasattr(obj, attr),
"{} shouldn't have the attribute: {}".format(obj, attr))