Skip to content

Codeforces changed the HTML around login #140

@kmyk

Description

@kmyk

Summary / 概要

tests.login_service.LoginServiceCodeforcesTest testMethod=test_login_failure failed.

Steps to reproduce / 再現方法

  1. pytest tests/*.py

Expected behavior / 期待される挙動

The tests pass.

Actual behavior / 実際の挙動

https://github.com/online-judge-tools/api-client/runs/2272180619

=================================== FAILURES ===================================
________________ LoginServiceCodeforcesTest.test_login_failure _________________

self = <tests.login_service.LoginServiceCodeforcesTest testMethod=test_login_failure>

    def test_login_failure(self) -> None:
        url = 'https://codeforces.com/'
        expected = {'status': 'error', 'messages': ['onlinejudge.type.LoginError: Invalid handle or password.'], 'result': None}
    
        with update_environ(USERNAME='online-judge-tools', PASSWORD='password'):
            with temporary_cookie() as cookie_path:
                actual = main(['--cookie', str(cookie_path), 'login-service', url], debug=True)
>       self.assertEqual(expected, actual)
E       AssertionError: {'sta[24 chars]': ['onlinejudge.type.LoginError: Invalid hand[29 chars]None} != {'sta[24 chars]': ['AssertionError'], 'result': None}
E       + {'messages': ['AssertionError'], 'result': None, 'status': 'error'}
E       - {'messages': ['onlinejudge.type.LoginError: Invalid handle or password.'],
E       -  'result': None,
E       -  'status': 'error'}

tests/login_service.py:80: AssertionError

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions