Exemplo n.º 1
0
    def runTest(self):
        """This function will update synonym under schema node."""

        synonym_response = synonym_utils.verify_synonym(
            self.server, self.db_name, self.synonym_name)
        if not synonym_response:
            raise Exception("No synonym node to update.")
        func_name = "test_function_synonym_%s" % str(uuid.uuid4())[1:8]
        self.table_id = functions_utils.create_trigger_function(
            self.server, self.db_name, self.schema_name, func_name,
            self.server_version)

        data = {
            "name": self.synonym_name,
            "synobjname": func_name,
            "synobjschema": self.schema_name,
            "targettype": "Function"
        }
        response = self.tester.put(
            self.url + str(utils.SERVER_GROUP) + '/' + str(self.server_id) +
            '/' + str(self.db_id) + '/' + str(self.schema_id) + '/' +
            str(self.syn_oid),
            data=json.dumps(data),
            follow_redirects=True)
        self.assertEqual(response.status_code, 200)
Exemplo n.º 2
0
    def runTest(self):
        """This function will update synonym under schema node."""

        synonym_response = synonym_utils.verify_synonym(self.server,
                                                        self.db_name,
                                                        self.synonym_name)
        if not synonym_response:
            raise Exception("No synonym node to update.")
        func_name = "test_function_synonym_%s" % str(uuid.uuid4())[1:8]
        self.table_id = functions_utils.create_trigger_function(
            self.server, self.db_name, self.schema_name, func_name,
            self.server_version)

        data = {
            "name": self.synonym_name,
            "synobjname": func_name,
            "synobjschema": self.schema_name,
            "targettype": "Function"
        }
        response = self.tester.put(
            self.url + str(utils.SERVER_GROUP) + '/' +
            str(self.server_id) + '/' +
            str(self.db_id) + '/' +
            str(self.schema_id) + '/' +
            str(self.synonym_name),
            data=json.dumps(data),
            follow_redirects=True)
        self.assertEquals(response.status_code, 200)