Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
feature-api-test
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
feature-api-test
Commits
1ba38314
Commit
1ba38314
authored
Jan 18, 2019
by
张鹏程
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改接口返回样式
parent
f5ad2bf5
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
40 additions
and
15 deletions
+40
-15
特征计算 - 多订单_test.ipynb
J_feature/特征计算 - 多订单_test.ipynb
+0
-0
Collection_Handler.py
handler/Collection_Handler.py
+1
-1
ComplexOrder_Handler.py
handler/ComplexOrder_Handler.py
+1
-1
Collection_Handler.cpython-34.pyc
handler/__pycache__/Collection_Handler.cpython-34.pyc
+0
-0
ComplexOrder_Handler.cpython-34.pyc
handler/__pycache__/ComplexOrder_Handler.cpython-34.pyc
+0
-0
Http_Requests.py
service/Http_Requests.py
+32
-1
auto_unittest.py
service/auto_unittest.py
+0
-3
test_collection.cpython-34.pyc
testcase/__pycache__/test_collection.cpython-34.pyc
+0
-0
test_trans_v2_read.py
testcase/test_trans_v2_read.py
+2
-4
JsonUtil.py
utils/JsonUtil.py
+4
-3
JsonUtil.cpython-34.pyc
utils/__pycache__/JsonUtil.cpython-34.pyc
+0
-0
tools.py
utils/tools.py
+0
-2
No files found.
J_feature/特征计算 - 多订单_test.ipynb
View file @
1ba38314
This diff is collapsed.
Click to expand it.
handler/Collection_Handler.py
View file @
1ba38314
...
@@ -19,7 +19,7 @@ class Collection(BaseHandler):
...
@@ -19,7 +19,7 @@ class Collection(BaseHandler):
self
.
write
(
JsonUtil
.
build_json_feature
(
businessType
=
int
(
_business_type
),
orderId
=
_orderId
,
loanId
=
_loanId
,
self
.
write
(
JsonUtil
.
build_json_feature
(
businessType
=
int
(
_business_type
),
orderId
=
_orderId
,
loanId
=
_loanId
,
user_uuid
=
_uuid
,
user_id
=
_user_id
,
_term_no
=
_termNo
,
user_uuid
=
_uuid
,
user_id
=
_user_id
,
_term_no
=
_termNo
,
features
=
_result
,
flag
=
True
,
code
=
200
))
features
=
_result
,
flag
=
True
,
code
=
JsonUtil
.
Constants
.
Code_Success
))
self
.
flush
()
self
.
flush
()
self
.
finish
()
self
.
finish
()
...
...
handler/ComplexOrder_Handler.py
View file @
1ba38314
...
@@ -17,7 +17,7 @@ class ComplexOrder(BaseHandler): # 多订单接口
...
@@ -17,7 +17,7 @@ class ComplexOrder(BaseHandler): # 多订单接口
_result
=
test_complex_order
.
complexOrder
(
_user_id
)
_result
=
test_complex_order
.
complexOrder
(
_user_id
)
self
.
write
(
JsonUtil
.
build_json_feature
(
businessType
=
int
(
_business_type
),
orderId
=
_orderId
,
loanId
=
_loanId
,
user_uuid
=
_uuid
,
user_id
=
_user_id
,
self
.
write
(
JsonUtil
.
build_json_feature
(
businessType
=
int
(
_business_type
),
orderId
=
_orderId
,
loanId
=
_loanId
,
user_uuid
=
_uuid
,
user_id
=
_user_id
,
features
=
_result
,
flag
=
True
,
code
=
200
))
features
=
_result
,
flag
=
True
,
code
=
JsonUtil
.
Constants
.
Code_Success
))
self
.
flush
()
self
.
flush
()
self
.
finish
()
self
.
finish
()
...
...
handler/__pycache__/Collection_Handler.cpython-34.pyc
View file @
1ba38314
No preview for this file type
handler/__pycache__/ComplexOrder_Handler.cpython-34.pyc
View file @
1ba38314
No preview for this file type
service/Http_Requests.py
View file @
1ba38314
from
utils.tools_requests
import
http
from
utils.tools_requests
import
http
from
collections
import
defaultdict
import
config.read_properties
as
cf
import
config.read_properties
as
cf
def
get_
http_response
(
host
,
url
,
params
=
None
,
file_path
=
None
,
method
=
'GET'
,
cookies
=
None
):
def
get_
response_http
(
host
,
url
,
params
=
None
,
file_path
=
None
,
method
=
'GET'
,
cookies
=
None
):
_init
=
http
(
ip
=
host
)
_init
=
http
(
ip
=
host
)
_request
=
_init
.
request_Met
(
url
=
url
,
params
=
params
,
method
=
method
,
cookies
=
cookies
)
_request
=
_init
.
request_Met
(
url
=
url
,
params
=
params
,
method
=
method
,
cookies
=
cookies
)
_response
=
_init
.
getJson
(
_request
)
_response
=
_init
.
getJson
(
_request
)
return
_response
return
_response
def
get_response_feature
(
host
,
url
,
params
=
None
,
code
=
None
,
headers
=
None
,
file_path
=
None
,
method
=
'GET'
,
cookies
=
None
):
_init
=
http
(
ip
=
host
)
_request
=
_init
.
request_Met
(
url
=
url
,
params
=
params
,
method
=
method
,
cookies
=
cookies
,
headers
=
headers
)
_response
=
_init
.
getJson
(
_request
)
return
_response
# def get_response_features(host,url,params = None,code = None,headers=None,file_path = None, method = 'GET',cookies = None,semlock = None):
#
# dict_assert = defaultdict(str)
# headers = {
# 'rc_auth_key':'rc_developer',
# 'rc_auth_secret':'rc_secret'
# }
# _init = http(ip=host)
# _request = _init.request_Met(url=url,params=params,method=method,cookies=cookies,headers = headers)
#
# url ='http://172.20.7.12:23010/calc/features'
#
# if _request.status_code == 200 and _request.json()['code'] == 200:
# _response = _init.getJson(_request)
# for key in _response['data']['features']:
# dict_assert[key] = r_json['data']['features'][key]['value']
# # print('-----------------')
#
# if semlock:
# semlock.release()
#
# return dict(dict_assert)
service/auto_unittest.py
View file @
1ba38314
...
@@ -37,10 +37,7 @@ class Test(unittest.TestCase):
...
@@ -37,10 +37,7 @@ class Test(unittest.TestCase):
with
open
(
filename
,
'wb'
)
as
fp
:
with
open
(
filename
,
'wb'
)
as
fp
:
# #定义测试报告
# #定义测试报告
runner
=
HTMLTestRunner
(
stream
=
fp
,
title
=
'测试报告'
,
description
=
'用例执行情况:'
,
verbosity
=
2
)
runner
=
HTMLTestRunner
(
stream
=
fp
,
title
=
'测试报告'
,
description
=
'用例执行情况:'
,
verbosity
=
2
)
runner
.
run
(
suite
)
runner
.
run
(
suite
)
fp
.
close
()
#关闭报告文件
fp
.
close
()
#关闭报告文件
else
:
else
:
print
(
'testcase type error'
)
print
(
'testcase type error'
)
...
...
testcase/__pycache__/test_collection.cpython-34.pyc
View file @
1ba38314
No preview for this file type
testcase/test_trans_v2_read.py
View file @
1ba38314
...
@@ -51,11 +51,9 @@ def test_trans_v2_read():
...
@@ -51,11 +51,9 @@ def test_trans_v2_read():
pass
pass
def
read_feature
():
def
read_feature
():
global
url
,
params
,
method
global
url
,
params
,
method
_response
=
Http_Requests
.
get_
http_response
(
_response
=
Http_Requests
.
get_
response_http
(
host
=
IP
.
FEATURE_HOST
,
host
=
IP
.
FEATURE_HOST
,
url
=
IP
.
url_trans_v2_read
,
url
=
IP
.
url_trans_v2_read
,
params
=
params
,
params
=
params
,
...
@@ -65,7 +63,7 @@ def read_feature():
...
@@ -65,7 +63,7 @@ def read_feature():
return
_response
return
_response
def
read_feature_my
():
def
read_feature_my
():
global
url
,
params
,
method
global
url
,
params
,
method
_response
=
Http_Requests
.
get_
http_response
(
_response
=
Http_Requests
.
get_
response_http
(
host
=
IP
.
FEATURE_HOST_MY
,
host
=
IP
.
FEATURE_HOST_MY
,
url
=
IP
.
url_trans_v2_read
,
url
=
IP
.
url_trans_v2_read
,
params
=
params
,
params
=
params
,
...
...
utils/JsonUtil.py
View file @
1ba38314
...
@@ -9,7 +9,7 @@ import json
...
@@ -9,7 +9,7 @@ import json
## 常数变量定义
## 常数变量定义
## json 返回中的 错误码定义
## json 返回中的 错误码定义
class
Constants
:
class
Constants
:
Code_Success
=
'
00
00'
Code_Success
=
'
2
00'
Msg_Success
=
'SUCCESS'
Msg_Success
=
'SUCCESS'
Code_Fail
=
1
Code_Fail
=
1
...
@@ -35,7 +35,7 @@ class Constants:
...
@@ -35,7 +35,7 @@ class Constants:
def
build_json_feature
(
features
=
None
,
**
kwargs
):
def
build_json_feature
(
features
=
None
,
code
=
None
,
**
kwargs
):
if
features
==
None
:
if
features
==
None
:
features
=
[]
features
=
[]
...
@@ -44,7 +44,8 @@ def build_json_feature(features=None,**kwargs):
...
@@ -44,7 +44,8 @@ def build_json_feature(features=None,**kwargs):
for
key
,
value
in
kwargs
.
items
():
for
key
,
value
in
kwargs
.
items
():
body
[
str
(
key
)]
=
value
body
[
str
(
key
)]
=
value
ddata
=
dict
(
body
,
features
=
eval
(
repr
(
features
)))
ddata
=
{
'code'
:
code
,
'data'
:
dict
(
subInfo
=
body
,
features
=
eval
(
repr
(
features
)))}
return
json
.
dumps
(
ddata
,
ensure_ascii
=
False
)
return
json
.
dumps
(
ddata
,
ensure_ascii
=
False
)
# businessType=int(_business_type), orderId=_orderId, loanId=_loanId,uuid = _uuid,
# businessType=int(_business_type), orderId=_orderId, loanId=_loanId,uuid = _uuid,
...
...
utils/__pycache__/JsonUtil.cpython-34.pyc
View file @
1ba38314
No preview for this file type
utils/tools.py
View file @
1ba38314
...
@@ -457,8 +457,6 @@ def return_LenValue(value,lens,types):
...
@@ -457,8 +457,6 @@ def return_LenValue(value,lens,types):
else
:
return
''
else
:
return
''
class
MyThread
(
threading
.
Thread
):
class
MyThread
(
threading
.
Thread
):
def
__init__
(
self
,
group
=
None
,
target
=
None
,
name
=
None
,
args
=
(),
kwargs
=
None
,
*
,
daemon
=
None
):
def
__init__
(
self
,
group
=
None
,
target
=
None
,
name
=
None
,
args
=
(),
kwargs
=
None
,
*
,
daemon
=
None
):
threading
.
Thread
.
__init__
(
self
,
group
,
target
,
name
,
args
,
kwargs
,
daemon
=
daemon
)
threading
.
Thread
.
__init__
(
self
,
group
,
target
,
name
,
args
,
kwargs
,
daemon
=
daemon
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment