debug.py 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import unittest
  2. import requests
  3. from util import req, reqGet, reqForm
  4. class MyTest(unittest.TestCase):
  5. def setUp(self) -> None:
  6. self.host = "http://127.0.0.1:8080" # local
  7. def test623(self):
  8. """【数据源】新增成功后,获取列表数据返回错误"""
  9. res = reqGet("https://edsp.rxdptest.k5.bigtree.tech/api/rxdp-xdata-web/dataSource/pageList", {})
  10. print(len(res['data']))
  11. res = req("https://edsp.rxdptest.k5.bigtree.tech/api/rxdp-xdata-web/dataSource",
  12. {"sourceType": "mysql", "sourceCode": "test23324", "sourceName": "test2134234", "sourceDesc": "",
  13. "driverName": "com.mysql.cj.jdbc.Driver",
  14. "jdbcUrl": "jdbc:mysql://mysql.rxdptest.svc.k5.bigtree.zone:3306/rxdp_auth", "username": "cs_user",
  15. "password": "ceshimima.1",
  16. "sourceConfig": "{\"driverName\":\"com.mysql.cj.jdbc.Driver\",\"jdbcUrl\":\"jdbc:mysql://mysql.rxdptest.svc.k5.bigtree.zone:3306/rxdp_auth\",\"username\":\"cs_user\",\"password\":\"ceshimima.1\"}"})
  17. print(res)
  18. res = reqGet("https://edsp.rxdptest.k5.bigtree.tech/api/rxdp-xdata-web/dataSource/pageList", {})
  19. print(len(res['data']))
  20. def testhttp(self):
  21. req("https://httpbin.org/post",
  22. {"username": "刘学良", "password": "lxl123456", "type": "account"})
  23. # 原子标签
  24. def testComputer(self):
  25. reqForm("http://localhost:8080/test/dealWithTagCompute", {
  26. "computeType": 3,
  27. "dataSourceCode": "mysqlTestHu123",
  28. "dataSourceType": "mysql",
  29. "dimensionNo": "10449",
  30. "dimensionsName": "amount",
  31. "entityName": "实体测试HU421445",
  32. "entityNo": "EN882632280592436445",
  33. "primaryKey": "projectcode",
  34. "primaryTableName": "shopping",
  35. "tagName": "采购类型222",
  36. "tagNo": "TAG16693657062277747"
  37. })
  38. # 衍生标签
  39. def testComputer2(self):
  40. reqForm("http://localhost:8080/test/dealWithTagCompute",
  41. {"computeType": 1, "dataSourceCode": "mysqlTestHu123", "dataSourceType": "mysql",
  42. "entityName": "mysqlTestShopping33333(mysql数据源)", "entityNo": "EN875254841037837824",
  43. "packageId": "rxdp/mySqlShoppingTest112", "primaryKey": "projectcode", "primaryTableName": "shopping",
  44. "statisticsCycle": "year", "statisticsCycleTime": "createtime",
  45. "tagName": "衍生标签测试多数据源mysql33333", "tagNo": "TAG16674623867383022", "timeStyle": "TS2"})
  46. # sql标签
  47. def testComputer3(self):
  48. reqForm("http://localhost:8080/test/dealWithTagCompute",
  49. {"computeType": 2, "dataSourceCode": "mysqlTestHu123", "dataSourceType": "mysql",
  50. "entityName": "mysql实体HU123", "entityNo": "EN879274694203750264", "primaryKey": "business_code",
  51. "primaryTableName": "shopping",
  52. "tagCompuleSql": "SELECT projectcode AS businessCode,amount AS tagValue FROM shopping LIMIT ${startNum},${endNum}",
  53. "tagName": "SQL标签HU1112", "tagNo": "TAG16684123244372739"})