本文整理汇总了Python中pystratum_test.TestDataLayer.TestDataLayer类的典型用法代码示例。如果您正苦于以下问题:Python TestDataLayer类的具体用法?Python TestDataLayer怎么用?Python TestDataLayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TestDataLayer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test3
def test3(self):
"""
An exception must be thrown when a stored routine with designation type singleton1 returns more than 1 values.
@expectedException Exception
"""
with self.assertRaises(ResultException):
TestDataLayer.tst_test_singleton1a(2)
示例2: test13
def test13(self):
"""
An exception must be thrown when a query returns more than 1 rows.
"""
with self.assertRaises(ResultException):
sql = 'select * from [dbo].[TST_FOO2] where tst_c00 <= 2'
TestDataLayer.execute_row0(sql)
示例3: test3
def test3(self):
"""
An exception must be thrown when a stored routine with designation type row1 returns more than 1 rows.
@expectedException Exception
"""
with self.assertRaises(Exception):
TestDataLayer.tst_test_row1a(2)
示例4: test1
def test1(self):
"""
Stored routine with designation type row1 must return 1 row and 1 row only.
"""
# ???
ret = TestDataLayer.tst_test_row1a(1)
ret = TestDataLayer.tst_test_row1a(1)
self.assertIsInstance(ret, dict)
示例5: test_argument_bit
def test_argument_bit(self):
result = TestDataLayer.tst_test_argument_bit(1)
self.assertEqual(result, "0001")
result = TestDataLayer.tst_test_argument_bit("110")
self.assertEqual(result, "1100")
result = TestDataLayer.tst_test_argument_bit("1010")
self.assertEqual(result, "1010")
示例6: setUp
def setUp(self):
TestDataLayer.config['host'] = 'localhost'
TestDataLayer.config['user'] = 'test'
TestDataLayer.config['password'] = 'test'
TestDataLayer.config['database'] = 'test'
TestDataLayer.connect()
self.held, sys.stdout = sys.stdout, StringIO()
示例7: test1
def test1(self):
"""
Stored routine with designation type rows must return an empty array when no rows are selected.
"""
ret = TestDataLayer.tst_test_rows1(0)
self.assertIsInstance(ret, list)
self.assertEqual(0, len(ret))
示例8: test3
def test3(self):
"""
Stored routine with designation type rows must return an array with 3 rows when 3 rows are selected.
"""
ret = TestDataLayer.tst_test_rows1(3)
self.assertIsInstance(ret, list)
self.assertEqual(3, len(ret))
示例9: test2
def test2(self):
"""
Stored routine with designation type rows must return an array with 1 row when only 1 row is selected.
"""
ret = TestDataLayer.tst_test_rows1(1)
self.assertIsInstance(ret, list)
self.assertEqual(1, len(ret))
示例10: test_none1
def test_none1(self):
"""
SQL without selecting rows.
"""
sql = 'insert into [TST_LABEL]([tst_test], [tst_label]) values(%s, %s)'
ret = TestDataLayer.execute_none(sql, ('test_none1', None))
self.assertIsNone(ret)
示例11: test1
def test1(self):
"""
Stored routine with designation type singleton0 must return null.
"""
from pystratum_test.TestDataLayer import TestDataLayer
ret = TestDataLayer.tst_test_singleton0a(0)
self.assertIsNone(ret)
示例12: test11b
def test11b(self):
"""
A query selecting 0 rows without arguments must return None.
"""
sql = 'select * from [dbo].[TST_FOO2] where tst_c00 <= 0'
ret = TestDataLayer.execute_row0(sql)
self.assertIsNone(ret)
示例13: test11a
def test11a(self):
"""
Test with query selecting 1 row with arguments.
"""
sql = 'select %s as "hello" from [dbo].[TST_FOO2] where tst_c00 <= %d'
ret = TestDataLayer.execute_row1(sql, ('hello', 1))
self.assertIsInstance(ret, dict)
示例14: test1
def test1(self):
"""
Stored routine with designation type singleton1 must return 1 value and 1 value only.
"""
from pystratum_test.TestDataLayer import TestDataLayer
ret = TestDataLayer.tst_test_singleton1a(1)
self.assertEqual(1, ret)
示例15: test2
def test2(self):
"""
Stored routine with designation type rows_with_key must return empty array when no rows are selected.
"""
rows = TestDataLayer.tst_test_rows_with_key1(0)
self.assertIsInstance(rows, dict)
self.assertEqual(0, len(rows))