Ejemplo n.º 1
0
    def test_resource_dir_add(self):
        test = DmpLogin()
        getCatalogListData = test.post_api(
            "/catalogController/getCatalogListData")
        for item in getCatalogListData['rows']:
            if item['CLASSIFYCODE'] == 'ci':
                #         del
                deleteCatalog = test.post_api(
                    "/catalogController/deleteCatalog", json=[item['ID']])
                assert deleteCatalog['code'] == '200'

        postsearchci = test.post_api("/catalogController/addCatalogInfo",
                                     json={
                                         "classifyCode": "ci",
                                         "classifyName": "ci",
                                         "descriptions": "",
                                         "pid": "-1",
                                         "pName": "",
                                         "contactPerson": "",
                                         "phone": "",
                                         "mobilePhone": "",
                                         "email": "",
                                         "orderid": ""
                                     })
        assert postsearchci['code'] == '200'
Ejemplo n.º 2
0
 def test_resource_dir_add_batch(self):
     test = DmpLogin()
     postsearchci = test.post_api("/catalogController/addCatalogInfo",
                                  json={
                                      "classifyCode":
                                      "ci" + str(TestReport.res_dir_index),
                                      "classifyName":
                                      "ci" + str(TestReport.res_dir_index),
                                      "descriptions":
                                      "",
                                      "pid":
                                      "-1",
                                      "pName":
                                      "",
                                      "contactPerson":
                                      "",
                                      "phone":
                                      "",
                                      "mobilePhone":
                                      "",
                                      "email":
                                      "",
                                      "orderid":
                                      ""
                                  })
     TestReport.res_dir_index = TestReport.res_dir_index + 1
     assert postsearchci['code'] == '200'
Ejemplo n.º 3
0
 def test_save_settingdata(self):
     test = DmpLogin()
     post = test.post_api(
         "/slaveServer/saveSlaveServer?name=kettle&hostName=127.0.0.1&port=8080&webAppName=&username=CeNTILgC6rOizgrFBjPCQQ%3D%3D&password=CeNTILgC6rOizgrFBjPCQQ%3D%3D&idSlave=&master=0",
         data=None)
     util.info(post)
     assert post['rtCode'] == '1'
Ejemplo n.º 4
0
 def test_database(self):
     '''
     加工厂数据共享新建分类
     :return:
     '''
     test = DmpLogin()
     postsearch = test.get_api("/api/db/database")
     print(postsearch)
     assert postsearch['data']["databaseName"] == 'slkfjlesfjl失而复得'
Ejemplo n.º 5
0
 def test_saveGroup(self):
     '''
     加工厂数据共享新建分类
     :return:
     '''
     test = DmpLogin()
     postsearch = test.post_api("/group/saveGroup",
                            json={"id": "", "pid": "234", "caption": "ci", "code": "ci", "type": "244",
                                  "content": "                        "})
     print(postsearch)
Ejemplo n.º 6
0
    def test_del_label_scope(self):
        test = DmpLogin()
        # try:
        data = {"dimname": "ddtest", "dimcode": "ddtest", "descriptions": "test", "pid": "-1", "orderid": "1"}
        postsave = test.post_api("/labelDimension/saveTagDimension", json=data)
        print(postsave)

        postsearch = test.get_api("/labelDimension/getDimensionListData",
                                   {"searchContent": "ddtest", "page": 1, "size": 20})
        print(postsearch)
        post = test.post_api("/labelDimension/deleteDimensionList", json=[postsearch['rows'][0]['ID']])
        util.info(post)
        # except Exception as e:
        #     print(e)
        #     util.info(e)
        assert postsave['code'] == '200'
        assert postsearch['total'] == 1
        assert post['code'] == '200'
Ejemplo n.º 7
0
    def test_saveGroup(self):
        '''
        加工厂数据共享新建分类
        :return:
        '''
        test = DmpLogin()

        postsearchci = test.post_api("/modeltree/getSearchNodeIDs",
                                     data={
                                         'rootID': 'iDF',
                                         'searchText': 'ci'
                                     })
        if len(postsearchci) == 0:
            saveGroup = test.post_api("/group/saveGroup",
                                      json={
                                          "id": "",
                                          "pid": "234",
                                          "caption": "ci",
                                          "code": "ci",
                                          "type": "244",
                                          "content": "                        "
                                      })
        postdb = test.post_api("/dbConnPool/getDbConnPoolList", data=None)
        postsearchci = test.post_api("/modeltree/getSearchNodeIDs",
                                     data={
                                         'rootID': 'iDF',
                                         'searchText': 'ci'
                                     })
        postsearchcirepo = test.post_api("/modeltree/getSearchNodeIDs",
                                         data={
                                             'rootID': 'iDF',
                                             'searchText': 'cirepo'
                                         })

        if len(postsearchcirepo) < 1:
            saveRepository = test.post_api("/repository/saveRepository",
                                           json={
                                               "id": None,
                                               "caption": "cirepo",
                                               "code": "cirepo",
                                               "nodePid": postsearchci[0],
                                               "nodeType": "253",
                                               "dbcpId": postdb[0]['DBCP_ID'],
                                               "dbType": "3",
                                               "description": "",
                                               "division": "",
                                               "industry": "",
                                               "leaddept": "",
                                               "impldept": ""
                                           })

            assert saveRepository['ID'] != None
Ejemplo n.º 8
0
class TestReport:
    @pytest.mark.parametrize("case,data,expected",
                             list(list_params),
                             ids=cases)
    def test_save_settingdata(self, case, data, expected):
        test = DmpLogin()
        setting_data = test.getSettingData()
        try:
            setting = json.loads(setting_data)
            data['id'] = setting['data']['basicInfoMap']['id']
            post = test.post_api("/gzapi/save", json=data)
            util.info(post)
        except Exception as e:
            util.info(e)
            post = test.post_api("/gzapi/save", json=data)
            util.info(post)

        assert post['rs'] == expected['rs']
Ejemplo n.º 9
0
 def test_getSettingData(self):
     test = DmpLogin()
     postsearch = test.get_api("/gzapi/getSettingData")
     print(postsearch)
Ejemplo n.º 10
0
 def test_getIdiEtlShow(self):
     test = DmpLogin()
     postsearch = test.get_api("/trans/getIdiEtlShow")
     print(postsearch)
Ejemplo n.º 11
0
 def test_getRootAndDirectChildNodeDATS(self):
     test = DmpLogin()
     postsearch = test.post_api("/modeltree/getRootAndDirectChildNode",
                                data={"id": "DATS"})
     print(postsearch)
     assert len(postsearch) > 0
Ejemplo n.º 12
0
 def test_modeltree(self):
     test = DmpLogin()
     data = {"id": "DAST"}
     post = test.post_api("/modeltree/getChildNode", data=data)
     assert len(post) > 0
Ejemplo n.º 13
0
 def test_lable_search_private_info_del(self):
     test = DmpLogin()
     postsearch = test.get_api("/tagManagement/addTagInfo",
                               {"searchContent": "ddtest", "page": 1, "size": 20})
     print(postsearch)
Ejemplo n.º 14
0
 def test_lable_search_private_info(self):
     test = DmpLogin()
     postsearch = test.get_api("/labelDimension/getDimensionListData",
                               {"searchContent": "ddtest", "page": 1, "size": 20})
     print(postsearch)
Ejemplo n.º 15
0
 def test_label_scope(self):
     test = DmpLogin()
     postsearch = test.get_api("/labelDimension/getDimensionListData",
                               { "page": 1, "size": 20})
     print(postsearch)
     assert postsearch['total']>=10