Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/Remake test_student_logged_in test. #15

Open
GabrielSimonetto opened this issue Apr 7, 2021 · 0 comments
Open

Refactor/Remake test_student_logged_in test. #15

GabrielSimonetto opened this issue Apr 7, 2021 · 0 comments
Labels

Comments

@GabrielSimonetto
Copy link
Member

As the docstring describes, this test needed to be removed for complications with the hardcoded manner in which it tests the functionality. I think magic mocks can solve this pretty well, but it someone has a better idea feel free to comment upon it

@network_needed
@requires_auth
@pytest.mark.skip(reason="Still needs work")
def test_student_logged_in():
    """This test used to work on the second semester of 2019.
    
    Then, the student progressed to other classes and the test began to fail.
    
    Solving this test will require a mock, or an adaptation of the student() function
        in order to fix the target semester of interest (if that is even possible) """

    cagr = CAGR()
    cagr.login(**CREDENTIALS)

    student = cagr.student("16100719")

    assert student.name == "Cauê Baasch de Souza"
    assert student.program == "CIÊNCIAS DA COMPUTAÇÃO"
    assert student.classes == [
        StudentClass(
            name="Redes de Computadores I",
            subject_id="INE5414",
            class_id="04208",
        ),
        StudentClass(
            name="Construção de Compiladores",
            subject_id="INE5426",
            class_id="06208",
        ),
        StudentClass(
            name="Planejamento e Gestão de Projetos",
            subject_id="INE5427",
            class_id="06208",
        ),
        StudentClass(
            name="Introdução ao Trabalho de Conclusão de Curso",
            subject_id="INE5453",
            class_id="06208",
        ),
        StudentClass(
            name="Bancos de Dados III",
            subject_id="INE5600",
            class_id="06238",
        ),
        StudentClass(
            name="Introdução à Internacionalização e Localização de Software",
            subject_id="INE5653",
            class_id="07238",
        )
    ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant