forked from testerSunshine/12306
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e97d1d
commit ad80669
Showing
15 changed files
with
120 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# coding=utf-8 | ||
import unittest | ||
from collections import OrderedDict | ||
|
||
import requests | ||
|
||
from agency.agency_tools import proxy | ||
from config.emailConf import sendEmail | ||
|
||
|
||
def _set_header_default(): | ||
header_dict = OrderedDict() | ||
header_dict["Accept"] = "*/*" | ||
header_dict["Accept-Encoding"] = "gzip, deflate" | ||
header_dict["X-Requested-With"] = "superagent" | ||
|
||
header_dict[ | ||
"User-Agent"] = "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1" | ||
header_dict["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8" | ||
|
||
|
||
class testAll(unittest.TestCase): | ||
|
||
def testProxy(self): | ||
""" | ||
测试代理是否可用 | ||
:return: | ||
""" | ||
_proxy = proxy() | ||
proxie = _proxy.setProxy() | ||
url = "http://httpbin.org/ip" | ||
rsp = requests.get(url, proxies=proxie, timeout=5, headers=_set_header_default()).content | ||
print(u"当前代理ip地址为: {}".format(rsp)) | ||
|
||
def testEmail(self): | ||
""" | ||
实测邮箱是否可用 | ||
:return: | ||
""" | ||
sendEmail("订票小助手测试一下") | ||
|
||
# def testConfig(self): | ||
# """ | ||
# 测试config是否配置正确 | ||
# :return: | ||
# """ | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,3 +133,4 @@ | |
- ticket_config 配置文件增加order_model字段(下单模式) | ||
- mac和linux服务器自动对点 | ||
- 增加预售踩点查询下单,经测试,误差在0.004s | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
119.101.114.196:9999 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,24 +30,6 @@ set: | |
# - "G1353" | ||
# - "G1329" | ||
station_trains: | ||
# - "G6114" | ||
# - "G1311" | ||
# - "G6201" | ||
# - "G821" | ||
# - "G1019" | ||
# - "G6587" | ||
# - "G2905" | ||
# - "G6345" | ||
# - "G6033" | ||
# - "G75" | ||
# - "G6025" | ||
# - "G6341" | ||
# - "G1021" | ||
# - "G99" | ||
# - "G6011" | ||
# - "D2972" | ||
# - "D1874" | ||
# - "D2834" | ||
- "G6172" | ||
- "G6186" | ||
- "G6154" | ||
|
@@ -76,14 +58,14 @@ set: | |
# - "梁敏" | ||
# 12306登录账号(list) | ||
12306account: | ||
- user: "[email protected]" | ||
- user: "13828728396" | ||
- pwd: "" | ||
|
||
# 加入小黑屋时间,此功能为了防止僵尸票导致一直下单不成功错过正常的票 | ||
# 加入小黑屋时间默认为5分钟,此功能为了防止僵尸票导致一直下单不成功错过正常的票, | ||
ticket_black_list_time: 5 | ||
|
||
# 自动打码 | ||
is_auto_code: False | ||
is_auto_code: True | ||
|
||
# 打码平台, 2 为若快平台(目前只支持若快平台打码,打码兔已经关闭), 若快注册地址:http://www.ruokuai.com/client/index?6726 | ||
auto_code_type: 2 | ||
|
@@ -127,5 +109,12 @@ order_model: 2 | |
# 预售放票时间, 如果是捡漏模式,可以忽略此操作 | ||
open_time: '13:00:00' | ||
|
||
# 是否开启代理, 0代表关闭, 1表示开始 | ||
# 开启此功能的时候请确保代理ip是否可用,在测试放里面经过充分的测试,再开启此功能,不然可能会耽误你购票的宝贵时间 | ||
# 使用方法: | ||
# 1、在agency/proxy_list列表下填入代理ip | ||
# 2、测试UnitTest/TestAll/testProxy 测试代理是否可以用 | ||
# 3、开启代理ip | ||
is_proxy: 0 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters