Commit f681bac8 by zhaihuitao

update

parents
# -*- coding: utf-8 -*-
"""
# @Time : 2022/3/8 10:35
# @Author : zhaiht
# @File : config.py
# @desc :
"""
Headers = {'Authorization': 'Bearer 43bc07a8-6d5e-4579-86e3-c9ee2a2de701',
'Content-Type': 'application/json;charset=UTF-8'}
url_test = "http://117.50.4.194"
url_prod = "http://gatling.reyun.com"
p2v = "/api-f/batchIm2Video/asyncBatchImg2V"
v2v = "/api-f/video2video/generatedAsync/false"
# -*- coding: utf-8 -*-
"""
# @Time : 2022/3/8 09:56
# @Author : zhaiht
# @File : param.py
# @desc :
"""
import json
title_id = json.load(open('title_id.json', 'r+'))['title_id'] + 1
json.dump({"title_id": title_id}, open('title_id.json', 'w+'), sort_keys=True, indent=4)
p2v = json.dumps({
"sizeId": 5,
"title": title_id,
"resultRule": "{标题}_{日期}_{序号}",
"img2VideoList": [
{
"content": "",
"duration": "10",
"floatLogoAlpha": 0.4,
"floatLogoMoveType": "NONE",
"floatLogoSpeed": 1,
"logoIndex": 1,
"musicUrl": "",
"recommendFlag": True,
"soundEffect": "fadeInOut",
"textIndex": 9,
"volumeNum": 30,
"combinationResList": [
{
"path": "root/image/jpg/9816ffcb5bf2454fac66377424d20be1.jpg",
"imgUrl": "https://gatling.cn-bj.ufileos.com/root%2Fimage%2Fjpg%2F9816ffcb5bf2454fac66377424d20be1.jpg?UCloudPublicKey=TOKEN_2ec337cb-d655-4803-9b2c-f1bb6af60cd6&Signature=9gmwB7ibSS1rcf0rNe%2FAYHinypg%3D&Expires=1645092905",
"duration": 5000
},
{
"path": "root/image/jpg/05dbaeba887145399dfbeda7a43f94f3.jpg",
"imgUrl": "https://gatling.cn-bj.ufileos.com/root%2Fimage%2Fjpg%2F05dbaeba887145399dfbeda7a43f94f3.jpg?UCloudPublicKey=TOKEN_2ec337cb-d655-4803-9b2c-f1bb6af60cd6&Signature=eN4KRWlhGH7C8hh3%2FSDkMcyQWpY%3D&Expires=1645092905",
"duration": 5000
}
]
}
],
"local": False,
"library": True
})
#######################################################
v2v = json.dumps({
"type": "video",
"music": "auto",
"ossCloud": True,
"sizeId": 6,
"title": title_id,
"resultRule": "{标题}_{序号}",
"videoParamGroups": [
{
"videoCombinations": [
{
"id": "1493837922917515264",
"type": "video",
"path": "root/video/mp4/f010e2a2294c4def9775c899bcbe2a13.mp4",
"ossVideoUrl": None,
"ossImageUrl": "https://gatling.cn-bj.ufileos.com/root%2Fimage%2Fjpg%2F2072a63727c74803ab5aace0f02fa878.jpg?UCloudPublicKey=TOKEN_2ec337cb-d655-4803-9b2c-f1bb6af60cd6&Signature=fwvdV3r%2BY6bHkLae%2BsSE5Ty9ByY%3D&Expires=1645513048",
"duration": None,
"soundEffect": None,
"volumeNum": None,
"musicUrl": None,
"logoIndex": 1,
"fontSize": None,
"content": None,
"fontFileUrl": None,
"textIndex": 9,
"floatLogoAlpha": 0.4,
"floatLogoSpeed": 1,
"floatLogoMoveType": "DEFAULT01",
"templateLevelDtos": None
},
{
"id": "1470667240268472320",
"type": "video",
"path": "root/video/mp4/51b855ab63eb4b9b89dc6550bc56e944.mp4",
"ossVideoUrl": None,
"ossImageUrl": "https://gatling.cn-bj.ufileos.com/root%2Fvideo%2Fmp4%2F66560d3cd5bd437ea96152af09769ada.mp4?UCloudPublicKey=TOKEN_2ec337cb-d655-4803-9b2c-f1bb6af60cd6&Signature=K2eRQq%2FDRWLgjpJ4OUiYoXWDJFo%3D&Expires=1645513048",
"duration": None,
"soundEffect": None,
"volumeNum": None,
"musicUrl": None,
"logoIndex": 1,
"fontSize": None,
"content": None,
"fontFileUrl": None,
"textIndex": 9,
"floatLogoAlpha": 0.4,
"floatLogoSpeed": 1,
"floatLogoMoveType": "DEFAULT01",
"templateLevelDtos": None
}
],
"name": "项目名称_20220217145806_1"
}
]
})
\ No newline at end of file
# -*- coding: utf-8 -*-
"""
# @Time : 2022/3/8 10:10
# @Author : zhaiht
# @File : testcase.py
# @desc :
"""
import json
import pytest
import requests
import param
import config
class TestGatlingAPI:
def test_p2v(self):
r = requests.post(url=config.url_prod + config.p2v, data=param.p2v, headers=config.Headers)
print(r.text)
assert r.status_code == 200
def test_v2v(self):
r = requests.post(url=config.url_prod + config.v2v, data=param.v2v, headers=config.Headers)
print(r.text)
assert r.status_code == 200
\ No newline at end of file
{
"title_id": 20220337
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment