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

Start linting the test #1710

Merged
merged 10 commits into from
Dec 10, 2021
Merged

Commits on Dec 9, 2021

  1. Fix more black warnings on test files

    The changes are automatic linting fixes from black.
    The target files are only those who test the new code.
    
    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    a728717 View commit details
    Browse the repository at this point in the history
  2. Address more pylint warnings on tests files

    All of the changes are made manual.
    The target files are only those who test the new code.
    
    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    8d73330 View commit details
    Browse the repository at this point in the history
  3. Address more mypy warnings on tests files

    All of the changes are made manual.
    The target files are only those who test the new code.
    
    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    5aa547d View commit details
    Browse the repository at this point in the history
  4. Rename old test files by adding old suffix

    Rename test files testing the old code by adding an "old" suffix.
    This is done, so we can easily exclude them from linting.
    
    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    22fe1e6 View commit details
    Browse the repository at this point in the history
  5. Start linting test files testing the new code

    Exclude regexs/globs are needed to exclude the test files testing
    the old code.
    After we remove those files we will be able to remove the exclude
    regex/globs.
    
    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    2f689e7 View commit details
    Browse the repository at this point in the history
  6. Missing mypy stubs in for dateutil.relativedelta

    Mypy reported a couple of errors for missing stubs on GitHub
    https://github.com/theupdateframework/python-tuf/runs/4431787287?check_suite_focus=true
    
    The error noted that:
    "tests/test_api.py:19: error: Library stubs not installed for
    "dateutil.relativedelta" (or incompatible with Python 3.10)"
    In order to resolve it I added "types-python-dateutil" into
    requirements-test.txt
    
    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    8e102b2 View commit details
    Browse the repository at this point in the history
  7. Add logging configuration in tests/test_examples

    Logging configuration is part from each test file begging from commit
    theupdateframework@03b15fb
    We should that as well for tests/test_examples.py
    
    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    d5d0b94 View commit details
    Browse the repository at this point in the history
  8. Simulator: make _fetch_{metadata,target} public

    Make _fetch_metadata and _fetch_taget public by renaming them to
    fetch_metadata and fetch_target.
    This will allow the removal of multiple pylint disables because of
    "accessing private members".
    
    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    a37df2e View commit details
    Browse the repository at this point in the history
  9. Mypy: disable attr-defined warning

    Mypy warns us when we assign a not defined variable to an object, but
    that is something that we are warned for from pylint (seach for
    "pylint: disable=no-member" in test_updater_key_rotations.py
    and you will find an example where we have to disable it).
    We don't want to have two linters checking for the same thing
    as we can end up disabling two warnings that are actually the same
    on a single line.
    
    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    811fa27 View commit details
    Browse the repository at this point in the history
  10. Metadata API: change bump_expiration delta type

    Change the delta argument type from the tuf/api/metadata.py module
    in Signed.bump_expiration() to include relativedelta as
    this provides an easier interface for the callers.
    We are already testing for that inside test/api line 338.
    
    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    28602e4 View commit details
    Browse the repository at this point in the history