本文整理汇总了Python中tests.helper.TestHelper类的典型用法代码示例。如果您正苦于以下问题:Python TestHelper类的具体用法?Python TestHelper怎么用?Python TestHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TestHelper类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: setUp
def setUp(self):
TestHelper.setUp(self)
class Class(object):
__storm_table__ = "table"
prop1 = Property("column1", primary=True)
self.Class = Class
self.ClassAlias = ClassAlias(self.Class, "alias")
开发者ID:DamnWidget,项目名称:mamba-storm,代码行数:7,代码来源:info.py
示例2: setUp
def setUp(self):
TestCase.setUp(self)
TestHelper.setUp(self)
self.threadpool = FakeThreadPool()
self.transaction = self.mocker.mock()
self.transactor = Transactor(self.threadpool, self.transaction)
self.function = self.mocker.mock()
开发者ID:Kelfast,项目名称:mamba-storm,代码行数:7,代码来源:transact.py
示例3: setUp
def setUp(self):
TestHelper.setUp(self)
self.executed = []
self.database = Database()
self.raw_connection = RawConnection(self.executed)
self.database.raw_connect = lambda: self.raw_connection
self.connection = Connection(self.database)
开发者ID:DamnWidget,项目名称:mamba-storm,代码行数:7,代码来源:database.py
示例4: setUp
def setUp(self):
TestHelper.setUp(self)
class Class(object):
__storm_table__ = "mytable"
prop1 = Custom("column1", primary=True)
prop2 = Custom()
prop3 = Custom("column3", default=50, allow_none=False)
class SubClass(Class):
__storm_table__ = "mysubtable"
self.Class = Class
self.SubClass = SubClass
开发者ID:anilbektash,项目名称:storm,代码行数:11,代码来源:properties.py
示例5: setUp
def setUp(self):
TestHelper.setUp(self)
# Allow classes with the same name in different tests to resolve
# property path strings properly.
SQLObjectBase._storm_property_registry.clear()
self.store = Store(create_database("sqlite:"))
class SQLObject(SQLObjectBase):
@staticmethod
def _get_store():
return self.store
self.SQLObject = SQLObject
self.store.execute("CREATE TABLE person "
"(id INTEGER PRIMARY KEY, name TEXT, age INTEGER,"
" ts TIMESTAMP, delta INTERVAL,"
" address_id INTEGER)")
self.store.execute("INSERT INTO person VALUES "
"(1, 'John Joe', 20, '2007-02-05 19:53:15',"
" '1 day, 12:34:56', 1)")
self.store.execute("INSERT INTO person VALUES "
"(2, 'John Doe', 20, '2007-02-05 20:53:15',"
" '42 days 12:34:56.78', 2)")
self.store.execute("CREATE TABLE address "
"(id INTEGER PRIMARY KEY, city TEXT)")
self.store.execute("INSERT INTO address VALUES (1, 'Curitiba')")
self.store.execute("INSERT INTO address VALUES (2, 'Sao Carlos')")
self.store.execute("CREATE TABLE phone "
"(id INTEGER PRIMARY KEY, person_id INTEGER,"
"number TEXT)")
self.store.execute("INSERT INTO phone VALUES (1, 2, '1234-5678')")
self.store.execute("INSERT INTO phone VALUES (2, 1, '8765-4321')")
self.store.execute("INSERT INTO phone VALUES (3, 2, '8765-5678')")
self.store.execute("CREATE TABLE person_phone "
"(id INTEGER PRIMARY KEY, person_id INTEGER, "
"phone_id INTEGER)")
self.store.execute("INSERT INTO person_phone VALUES (1, 2, 1)")
self.store.execute("INSERT INTO person_phone VALUES (2, 2, 2)")
self.store.execute("INSERT INTO person_phone VALUES (3, 1, 1)")
class Person(self.SQLObject):
_defaultOrder = "-Person.name"
name = StringCol()
age = IntCol()
ts = UtcDateTimeCol()
self.Person = Person
开发者ID:datnguyen0606,项目名称:storm,代码行数:52,代码来源:sqlobject.py
示例6: test_crazy_metaclass
def test_crazy_metaclass(self):
"""We don't want metaclasses playing around when we build an alias."""
TestHelper.setUp(self)
class MetaClass(type):
def __new__(meta_cls, name, bases, dict):
cls = type.__new__(meta_cls, name, bases, dict)
cls.__storm_table__ = "HAH! GOTCH YA!"
return cls
class Class(object):
__metaclass__ = MetaClass
__storm_table__ = "table"
prop1 = Property("column1", primary=True)
Alias = ClassAlias(Class, "USE_THIS")
self.assertEquals(Alias.__storm_table__, "USE_THIS")
开发者ID:DamnWidget,项目名称:mamba-storm,代码行数:14,代码来源:info.py
示例7: setUp
def setUp(self):
TestHelper.setUp(self)
class Class(object):
__storm_table__ = "mytable"
prop1 = Custom("column1", primary=True, size=11, unsigned=True)
prop2 = Custom()
prop3 = Custom("column3", default=50, allow_none=False)
prop4 = Custom(
"column4", index=True, unique=True, auto_increment=True,
array={'other_value': 1}
)
class SubClass(Class):
__storm_table__ = "mysubtable"
self.Class = Class
self.SubClass = SubClass
开发者ID:DamnWidget,项目名称:mamba-storm,代码行数:17,代码来源:properties.py
示例8: setUp
def setUp(self):
TestHelper.setUp(self)
EmptyResultSetTest.setUp(self)
开发者ID:datnguyen0606,项目名称:storm,代码行数:3,代码来源:postgres.py
示例9: setUp
def setUp(self):
TestHelper.setUp(self)
self.event = EventSystem(marker)
开发者ID:DamnWidget,项目名称:mamba-storm,代码行数:3,代码来源:event.py
示例10: tearDown
def tearDown(self):
if 'factory' in storm.database._database_schemes:
del storm.database._database_schemes['factory']
TestHelper.tearDown(self)
开发者ID:DamnWidget,项目名称:mamba-storm,代码行数:4,代码来源:database.py
示例11: tearDown
def tearDown(self):
TestHelper.tearDown(self)
StoreTest.tearDown(self)
开发者ID:datnguyen0606,项目名称:storm,代码行数:3,代码来源:postgres.py
注:本文中的tests.helper.TestHelper类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论