• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python TestDataLayer.TestDataLayer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pystratum_test.TestDataLayer.TestDataLayer的典型用法代码示例。如果您正苦于以下问题:Python TestDataLayer类的具体用法?Python TestDataLayer怎么用?Python TestDataLayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了TestDataLayer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: test11a

 def test11a(self):
     """
     A query selecting 0 rows with arguments must return None.
     """
     sql = 'select %s as "hello" from [dbo].[TST_FOO2] where tst_c00 <= %d'
     ret = TestDataLayer.execute_row0(sql, ('hello', 0))
     self.assertIsNone(ret)
开发者ID:SetBased,项目名称:py-stratum-mssql,代码行数:7,代码来源:Row0Test.py


示例17: test11c

 def test11c(self):
     """
     Test with query selecting 1 row without arguments.
     """
     sql = 'select * from [dbo].[TST_FOO2] where tst_c00 <= 1'
     ret = TestDataLayer.execute_row1(sql)
     self.assertIsInstance(ret, dict)
开发者ID:SetBased,项目名称:py-stratum-mssql,代码行数:7,代码来源:Row1Test.py


示例18: test4

 def test4(self):
     """
     Test constant __DIR__. Must return name of the folder where the source file of routine the is located.
     """
     dir_cur_file = os.path.dirname(os.path.abspath(__file__))
     dir_name = os.path.realpath(dir_cur_file + '/psql')
     ret = TestDataLayer.tst_magic_constant04()
     self.assertEqual(dir_name, ret)
开发者ID:SetBased,项目名称:py-stratum-mysql,代码行数:8,代码来源:MagicConstantTest.py


示例19: test13c

 def test13c(self):
     """
     Test with query selecting 3 rows without arguments.
     """
     sql = 'select * from [dbo].[TST_FOO2] where [tst_c00] <= 3'
     ret = TestDataLayer.execute_rows(sql)
     self.assertIsInstance(ret, list)
     self.assertEqual(3, len(ret))
开发者ID:SetBased,项目名称:py-stratum-mssql,代码行数:8,代码来源:RowsTest.py


示例20: _test1

    def _test1(self):
        """
        Stored routine with designation type table must show table.
        @todo implement designation type table
        """
        template_table = """
+---------+---------+---------+---------+---------------------+------+------+
| tst_c00 | tst_c01 | tst_c02 | tst_c03 |       tst_c04       |  t   |  s   |
+---------+---------+---------+---------+---------------------+------+------+
| Hello   |       1 |   0.543 | 1.23450 | 2014-03-27 00:00:00 | 4444 |    1 |
| World   |       3 | 0.00003 | 0.00000 | 2014-03-28 00:00:00 |      |    1 |
+---------+---------+---------+---------+---------------------+------+------+
"""

        TestDataLayer.tst_test_table()
        table = sys.stdout
        self.assertEqual(table, template_table)
开发者ID:SetBased,项目名称:py-stratum-mysql,代码行数:17,代码来源:TableTest.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python datasets.generate_blocks函数代码示例发布时间:2022-05-27
下一篇:
Python StaticDataLayer.StaticDataLayer类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap