5
5
from codeforces_api import CodeforcesApi
6
6
7
7
8
- def test_blog_entry_comments (api_key , api_secret ):
9
- api = CodeforcesApi (api_key , api_secret )
8
+ def test_blog_entry_comments ():
9
+ api = CodeforcesApi ()
10
10
comments = api .blog_entry_comments (74291 )
11
11
for comment in comments :
12
12
if comment .id == 584151 :
13
13
assert comment .creation_time_seconds == 1582795345
14
14
15
15
16
- def test_blog_entry_view (api_key , api_secret ):
17
- api = CodeforcesApi (api_key , api_secret )
16
+ def test_blog_entry_view ():
17
+ api = CodeforcesApi ()
18
18
blog_entry = api .blog_entry_view (74291 )
19
19
assert blog_entry .author_handle == "VadVergasov"
20
20
assert blog_entry .original_locale == "ru"
@@ -32,8 +32,8 @@ def test_blog_entry_view(api_key, api_secret):
32
32
assert blog_entry .content is None
33
33
34
34
35
- def test_contest_hacks (api_key , api_secret ):
36
- api = CodeforcesApi (api_key , api_secret )
35
+ def test_contest_hacks ():
36
+ api = CodeforcesApi ()
37
37
hacks = api .contest_hacks (1311 )
38
38
for hack in hacks :
39
39
if hack .id == 615666 :
@@ -93,8 +93,8 @@ def test_contest_list():
93
93
break
94
94
95
95
96
- def test_contest_rating_changes (api_key , api_secret ):
97
- api = CodeforcesApi (api_key , api_secret )
96
+ def test_contest_rating_changes ():
97
+ api = CodeforcesApi ()
98
98
changes = api .contest_rating_changes (1313 )
99
99
for change in changes :
100
100
if change .handle == "VadVergasov" :
@@ -107,8 +107,8 @@ def test_contest_rating_changes(api_key, api_secret):
107
107
break
108
108
109
109
110
- def test_contest_standings (api_key , api_secret ):
111
- api = CodeforcesApi (api_key , api_secret )
110
+ def test_contest_standings ():
111
+ api = CodeforcesApi ()
112
112
standings = api .contest_standings (1313 , handles = ["VadVergasov" ])
113
113
assert standings ["contest" ].id == 1313
114
114
assert standings ["contest" ].name == "Codeforces Round #622 (Div. 2)"
@@ -197,8 +197,8 @@ def test_contest_status():
197
197
assert row .points is None
198
198
199
199
200
- def test_problemset_problems (api_key , api_secret ):
201
- api = CodeforcesApi (api_key , api_secret )
200
+ def test_problemset_problems ():
201
+ api = CodeforcesApi ()
202
202
problemset = api .problemset_problems ()
203
203
for problem in problemset ["problems" ]:
204
204
if problem .name == "Single Push" :
@@ -215,8 +215,8 @@ def test_problemset_problems(api_key, api_secret):
215
215
assert isinstance (statistic .contest_id , int )
216
216
217
217
218
- def test_recent_status (api_key , api_secret ):
219
- api = CodeforcesApi (api_key , api_secret )
218
+ def test_recent_status ():
219
+ api = CodeforcesApi ()
220
220
status = api .problemset_recent_status (1 )[0 ]
221
221
assert isinstance (status .id , int )
222
222
assert isinstance (status .creation_time_seconds , int )
@@ -233,8 +233,8 @@ def test_recent_status(api_key, api_secret):
233
233
assert status .points is None or isinstance (status .points , float )
234
234
235
235
236
- def test_recent_actions (api_key , api_secret ):
237
- api = CodeforcesApi (api_key , api_secret )
236
+ def test_recent_actions ():
237
+ api = CodeforcesApi ()
238
238
action = api .recent_actions ()[0 ]
239
239
assert isinstance (action .time_seconds , int )
240
240
if hasattr (action , "blog_entry" ):
@@ -243,8 +243,8 @@ def test_recent_actions(api_key, api_secret):
243
243
assert isinstance (action .comment , Comment )
244
244
245
245
246
- def test_user_blog_entries (api_key , api_secret ):
247
- api = CodeforcesApi (api_key , api_secret )
246
+ def test_user_blog_entries ():
247
+ api = CodeforcesApi ()
248
248
entries = api .user_blog_entries ("VadVergasov" )
249
249
for entry in entries :
250
250
if entry .id == 74291 :
@@ -264,14 +264,8 @@ def test_user_blog_entries(api_key, api_secret):
264
264
assert entry .content is None
265
265
266
266
267
- def test_user_friends (api_key , api_secret ):
268
- api = CodeforcesApi (api_key , api_secret )
269
- friends = api .user_friends ()
270
- assert "aropan" in friends or "gepardo" in friends
271
-
272
-
273
- def test_user_info (api_key , api_secret , check_user ):
274
- api = CodeforcesApi (api_key , api_secret )
267
+ def test_user_info (check_user ):
268
+ api = CodeforcesApi ()
275
269
info = api .user_info (["VadVergasov" , "tourist" ])
276
270
for user in info :
277
271
check_user (user )
0 commit comments