Skip to content

Commit fa455a0

Browse files
committed
Added tests
1 parent bb249d4 commit fa455a0

File tree

4 files changed

+34
-2
lines changed

4 files changed

+34
-2
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dist/
22
build/
33
CodeforcesApiPy.egg-info
4-
tests/
4+
tests/conf.py
55
.pylintrc
66
codeforces_api/__pycache__/

codeforces_api/api_requests.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class CodeforcesApi(CodeforcesApiRequestMaker):
1313

1414
def blog_entry_comments(self, blog_entry_id):
1515
"""
16-
Get blogEntry.commnets for blog, blog_entry_id required.
16+
Get blogEntry.commnets for blog , blog_entry_id required.
1717
Returns parsed response from codeforces.com.
1818
"""
1919
request = requests.get(

tests/conf.py.template

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
API_KEY = "{str}"
2+
API_SECRET = "{str}"

tests/main.py

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"""
2+
Testing module work.
3+
"""
4+
5+
import conf
6+
import codeforces_api
7+
8+
MAIN = codeforces_api.CodeforcesApi(conf.API_KEY, conf.API_SECRET)
9+
10+
PARSER = codeforces_api.CodeforcesParser()
11+
12+
COMMENTS = MAIN.blog_entry_comments(74185)
13+
VIEW = MAIN.blog_entry_view(74185)
14+
HACKS = MAIN.contest_hacks(1311)
15+
LIST = MAIN.contest_list()
16+
RATING_CHANGES = MAIN.contest_rating_changes(1311)
17+
STANDINGS = MAIN.contest_standings(1311, handles=["tourist", "VadVergasov"])
18+
STATUS = MAIN.contest_status(1311)
19+
PROBLEMS = MAIN.problemset_problems()
20+
RECENT_STATUS = MAIN.problemset_recent_status(10)
21+
RECENT_ACTIONS = MAIN.recent_actions()
22+
USER_ENTRIES = MAIN.user_blog_entries("VadVergasov")
23+
FRIENDS = MAIN.user_friends(True)
24+
INFO = MAIN.user_info(["tourist", "VadVergasov"])
25+
RATINGS = MAIN.user_rated_list(True)
26+
USER_RATING = MAIN.user_rating("VadVergasov")
27+
USER_STATUS = MAIN.user_status("VadVergasov")
28+
29+
SOLUTION = PARSER.get_solution(1322, 72628149)
30+

0 commit comments

Comments
 (0)