当前位置: 首页>>代码示例>>Python>>正文


Python TestDataLayer.TestDataLayer类代码示例

本文整理汇总了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)
开发者ID:SetBased,项目名称:py-stratum-mysql,代码行数:7,代码来源:Singleton1Test.py

示例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)
开发者ID:SetBased,项目名称:py-stratum-mssql,代码行数:7,代码来源:Row0Test.py

示例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)
开发者ID:SetBased,项目名称:py-stratum-pgsql,代码行数:7,代码来源:Row1Test.py

示例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)
开发者ID:SetBased,项目名称:py-stratum-mysql,代码行数:8,代码来源:Row1Test.py

示例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")
开发者ID:SetBased,项目名称:py-stratum-pgsql,代码行数:9,代码来源:OverloadingTest.py

示例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()
开发者ID:SetBased,项目名称:py-stratum-mysql,代码行数:9,代码来源:StratumTestCase.py

示例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))
开发者ID:SetBased,项目名称:py-stratum-mysql,代码行数:7,代码来源:RowsTest.py

示例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))
开发者ID:SetBased,项目名称:py-stratum-mysql,代码行数:7,代码来源:RowsTest.py

示例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))
开发者ID:SetBased,项目名称:py-stratum-mysql,代码行数:7,代码来源:RowsTest.py

示例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)
开发者ID:SetBased,项目名称:py-stratum-mssql,代码行数:7,代码来源:NoneTest.py

示例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)
开发者ID:SetBased,项目名称:py-stratum-mysql,代码行数:7,代码来源:Singleton0Test.py

示例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)
开发者ID:SetBased,项目名称:py-stratum-mssql,代码行数:7,代码来源:Row0Test.py

示例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)
开发者ID:SetBased,项目名称:py-stratum-mssql,代码行数:7,代码来源:Row1Test.py

示例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)
开发者ID:SetBased,项目名称:py-stratum-mysql,代码行数:7,代码来源:Singleton1Test.py

示例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))
开发者ID:SetBased,项目名称:py-stratum-mysql,代码行数:7,代码来源:RowsWithKeyTest.py


注:本文中的pystratum_test.TestDataLayer.TestDataLayer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。