flink.py 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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, "dataSourceCode": "tn_markting_db", "dataSourceType": "oracle",
  27. "dimensionNo": "10610", "dimensionsName": "GENDER", "entityName": "tn营销基本信息",
  28. "entityNo": "EN892456279547714785", "primaryKey": "CST_ID", "primaryTableName": "DC_CST_INFO",
  29. "tagName": "性别0-未知的性别1-男性2-女性9-未说明的性别", "tagNo": "TAG16693487690724795",
  30. "tenantId": "TENA883826260025957899"})
  31. # 衍生标签
  32. def testComputer2(self):
  33. reqForm("http://localhost:8080/test/dealWithTagCompute",
  34. {"computeType": 1, "dataSourceCode": "mysqlTestHu123", "dataSourceType": "mysql",
  35. "entityName": "mysqlTestShopping33333(mysql数据源)", "entityNo": "EN875254841037837824",
  36. "packageId": "rxdp/mySqlShoppingTest112", "primaryKey": "projectcode", "primaryTableName": "shopping",
  37. "statisticsCycle": "year", "statisticsCycleTime": "createtime",
  38. "tagName": "衍生标签测试多数据源mysql33333", "tagNo": "TAG16674623867383022", "timeStyle": "TS2",
  39. "tenantId": "test-test-test2"})
  40. # sql标签
  41. def testComputer3(self):
  42. reqForm("http://localhost:8080/test/dealWithTagCompute",
  43. {"computeType": 2, "dataSourceCode": "mysqlTestHu123", "dataSourceType": "mysql",
  44. "entityName": "mysql实体HU123", "entityNo": "EN879274694203750264", "primaryKey": "business_code",
  45. "primaryTableName": "shopping",
  46. "tagCompuleSql": "SELECT projectcode AS businessCode,amount AS tagValue FROM shopping LIMIT ${startNum},${endNum}",
  47. "tagName": "SQL标签HU1112", "tagNo": "TAG16684123244372739", "tenantId": "test-test-test3"})