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

Increase pytest coverage by either adding tests or removing unused code #31

Merged
merged 7 commits into from
Sep 21, 2021
Merged

Commits on Sep 15, 2021

  1. TestTspClient: Add complete{d} timegraph tree test

    Base this new test on the existing test_fetch_xy. Rename the hereby
    reused REQUESTED_TIME constants accordingly; no longer XY-specific.
    
    Don't redundantly assert model_type; test_fetch_timegraph_tree does so
    already. Now, adding this test increases test coverage (cf. README) in
    these specific ways:
    
    - time_graph_model.py: from 25% to 33%;
    - entry_model.py:      from 84% to 88%;
    - response.py:         from 86% to 89%.
    
    <=> From 59% to 60% total. More work remains then to cover tsp/ further.
    
    Signed-off-by: Marco Miller <[email protected]>
    marco-miller committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    a505f60 View commit details
    Browse the repository at this point in the history
  2. TestTspClient: Remove duplication just introduced

    Remove the duplication introduced by test_fetch_timegraph_tree_complete,
    which was based on test_fetch_xy. Add the private __requested_parameters
    helper method for this.
    
    Signed-off-by: Marco Miller <[email protected]>
    marco-miller committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    f76f462 View commit details
    Browse the repository at this point in the history
  3. Remove the unused DataType class w/ its whole file

    Signed-off-by: Marco Miller <[email protected]>
    marco-miller committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    9ed278d View commit details
    Browse the repository at this point in the history
  4. Remove storing unspecified parameters in 'others'

    If some data is needed to be transferred between server and clients over
    the TSP, then it needs to properly be specified in the TSP, so that
    clients and server can support it.
    
    Fixes #35
    
    Signed-off-by: Marco Miller <[email protected]>
    marco-miller committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    5fcdbc3 View commit details
    Browse the repository at this point in the history
  5. EntryModel: Remove redundant local variable

    Signed-off-by: Marco Miller <[email protected]>
    marco-miller committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    9a62793 View commit details
    Browse the repository at this point in the history
  6. Tree{Model,Item}: Move out of tsp/ package; cli's

    Move tree_model.py's whole content (both classes) out of the tsp/
    package, as only ./tsp-cli-client uses it. Make the file a sibling of
    the latter, as duly expected.
    
    This move also solves the issue of tsp/ pytest coverage previously
    reporting that file as not covered at all.
    
    Signed-off-by: Marco Miller <[email protected]>
    marco-miller committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    3a73eb2 View commit details
    Browse the repository at this point in the history
  7. Add pragma(s) where no pytest coverage necessary

    The pytest(s) coverage and its reporting is not meant to cover all
    paths. Add no-cover pragma directives to uncovered paths that may be
    safely ignored by pytest reporting. Do so as the scope of these tests is
    mainly integration and main coverage of client paths towards the server.
    
    Ignore paths such as negative or corner (thus less likely) cases. Ignore
    paths also that are either TODO code or manual cli printouts and cases.
    
    The remaining uncovered lines are backlogged to be covered further, yet
    through larger efforts. README has the pytest command showing the
    report, which currently shows 80% coverage (round number a coincidence).
    
    Some no-cover pragmas might be removed as some more paths end up being
    covered, through potential pytest or code amends.
    
    Signed-off-by: Marco Miller <[email protected]>
    marco-miller committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    d298b91 View commit details
    Browse the repository at this point in the history