Skip to content

Commit

Permalink
feat: csg-cpc spider
Browse files Browse the repository at this point in the history
Signed-off-by: Dup4 <lyuzhi.pan@gmail.com>
  • Loading branch information
Dup4 committed Oct 14, 2023
1 parent b70df68 commit d8a12fe
Show file tree
Hide file tree
Showing 19 changed files with 20,993 additions and 65 deletions.
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
"gevent",
"grequests",
"gxcpc",
"hbcpc",
"hncpc",
"icpc",
"KHTML",
"mktime",
Expand All @@ -24,6 +26,8 @@
"pyright",
"pytest",
"Referer",
"tkind",
"tmember",
"XCPCIO",
"xlrd"
],
Expand Down
16 changes: 7 additions & 9 deletions tests/spider/csg_cpc/v1/csg_cpc_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,24 @@
current_dir_path = os.path.dirname(current_file_path)

team_uris = [
os.path.join(current_dir_path, "test_data/2023_gdcpc/team_list_1004.json"),
os.path.join(current_dir_path, "test_data/2023_gdcpc/team_list_1005.json"),
os.path.join(current_dir_path, "test_data/2023_hncpc/team_list.json"),
]

run_uris = [
os.path.join(current_dir_path, "test_data/2023_gdcpc/run_list_1004.json"),
os.path.join(current_dir_path, "test_data/2023_gdcpc/run_list_1005.json"),
os.path.join(current_dir_path, "test_data/2023_hncpc/run_list.json"),
]


def test_spider_csg_cpc_v1_2023_gdcpc(snapshot):
def test_spider_csg_cpc_v1_2023_hncpc(snapshot):
c = Contest()
c.start_time = utils.get_timestamp_second("2023-05-14 10:00:00")
c.end_time = utils.get_timestamp_second("2023-05-14 15:00:00")
c.start_time = utils.get_timestamp_second("2023-09-17 09:00:00")
c.end_time = utils.get_timestamp_second("2023-09-17 14:00:00")

csg_cpc = CSG_CPC(c, team_uris, run_uris)
csg_cpc.fetch().parse_teams().parse_runs()

assert len(csg_cpc.teams) == 302
assert len(csg_cpc.runs) == 4381
assert len(csg_cpc.teams) == 180
assert len(csg_cpc.runs) == 2336

snapshot.assert_match(csg_cpc.teams.get_json, "teams")
snapshot.assert_match(csg_cpc.runs.get_json, "runs")

This file was deleted.

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit d8a12fe

Please sign in to comment.