Skip to content

Tests refactored code: reorganize testing in test_api #1414

@MVrachev

Description

@MVrachev

Description of issue or feature request:
Currently, there are too many things tested in tuf/test_apy.py including:

There are multiple occurrences wherein a single test function we have the first two tested
and additional specific testing added.

I propose to:

  1. Create a new testing folder that will contain test modules for the refactored code. Named for example test_refactor
  2. Split test_api into multiple logical test modules.
    For example: test_serialization_deserialization (I can't think of an alternative name...) and test_metadata_api (which will contain only API specific to the metadata classes without (de)serialization tests),
  3. Move those new test modules into the new folder.
  4. Make sure we can run all tests in the new test folder together with the other tests or in other words make the necessary changes in tests/aggregate_tests.py.

The reason why I propose splitting test_api is that it's bloated and hard to navigate through.

Additionally, I think that a separate folder for the refactored code will be useful long term considering we are going to add more and more refactored code that should be tested.
Then, one day when we fully replace the old code with the refactored code we can just remove all of the old tests and move the
content of this new folder into the tests folder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogIssues to address with priority for current development goalstesting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions