Skip to content

Tests for Archival Data #61

@phi-line

Description

@phi-line

With such a massive amount of data (100,000 courses) being added with the #59 archive scraper, we need a way to check if all the correct keys for section data exist. An automated test should be made with pytest. You can find some of the examples that we've made in tests/test_server.py.

Here's a snippet to get you started:

class TestGenerateURL(TestCase):
    def test_sample_url_can_be_generated(self):
        self.assertEqual(
            test_data.test_sample_url_can_be_generated_data,
            generate_url('test_dept', 'test_course')
)

This class calls the generate_url() function with two example parameters and check to see if the result is equal to that found in the test_data file's copy. assertEqual will return 0 if it passes, and and 1 if it fails. All failed tests will be flagged with pytest.

Post here if you have any questions regarding how to start on this task. The archival data will not be ready until #59 has been merged.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions