Skip to content

Commit

Permalink
online-judge-tools#538: Test codeforces.list_problems
Browse files Browse the repository at this point in the history
  • Loading branch information
fukatani committed Oct 19, 2019
1 parent 7af9976 commit d9a39f9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/service_codeforces.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_from_url(self):
self.assertEqual(CodeforcesContest.from_url('http://codeforces.com/gym/101025').contest_id, 101025)
self.assertIsNone(CodeforcesContest.from_url('https://atcoder.jp/contests/abc120'))

def test_list_problems(self):
def test_list_problems_data(self):
contest = CodeforcesContest.from_url('https://codeforces.com/contest/1157')
problems = contest.list_problem_data()
self.assertEqual(len(problems), 8)
Expand All @@ -31,6 +31,14 @@ def test_list_problems(self):
self.assertEqual(problems[6].tags, ['constructive algorithms', 'dp', 'greedy', 'two pointers'])
self.assertEqual(problems[7].tags, ['brute force', 'constructive algorithms'])

def test_list_problems(self):
contest = CodeforcesContest.from_url('https://codeforces.com/contest/1157')
problems = contest.list_problems()
self.assertEqual(len(problems), 8)
self.assertEqual(problems[0].get_url(), 'https://codeforces.com/contest/1157/problem/A')
self.assertEqual(problems[6].get_url(), 'https://codeforces.com/contest/1157/problem/F')
self.assertEqual(problems[7].download_data().tags, ['brute force', 'constructive algorithms'])

def test_download_data(self):
contest = CodeforcesContest.from_url('http://codeforces.com/contest/1200')
data = contest.download_data()
Expand Down

0 comments on commit d9a39f9

Please sign in to comment.