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

Added statistics endpoints and tests #542

Merged
merged 12 commits into from
Feb 23, 2021
Merged

Added statistics endpoints and tests #542

merged 12 commits into from
Feb 23, 2021

Conversation

any333
Copy link
Contributor

@any333 any333 commented Feb 17, 2021

No description provided.

@any333 any333 requested a review from jstucke February 17, 2021 13:00
@codecov-io
Copy link

codecov-io commented Feb 17, 2021

Codecov Report

Merging #542 (f892a6f) into master (22faf71) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #542   +/-   ##
=======================================
  Coverage   95.62%   95.63%           
=======================================
  Files         304      306    +2     
  Lines       18311    18371   +60     
=======================================
+ Hits        17510    17569   +59     
- Misses        801      802    +1     
Impacted Files Coverage Δ
src/web_interface/rest/rest_status.py 96.77% <ø> (ø)
...gration/web_interface/rest/test_rest_statistics.py 100.00% <100.00%> (ø)
src/web_interface/rest/rest_base.py 100.00% <100.00%> (ø)
src/web_interface/rest/rest_statistics.py 100.00% <100.00%> (ø)
...test/integration/scheduler/test_cycle_with_tags.py 98.07% <0.00%> (-1.93%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 22faf71...74ea479. Read the comment docs.

Copy link
Collaborator

@jstucke jstucke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work fine already. It just needs bit of refactoring and tweaking the tests a little

def test_rest_request_single_statistic(self):
st = self.test_client.get('/rest/statistics/known_vulnerabilities', follow_redirects=True)

assert b'known_vulnerabilities' in st.data
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would make sense to also check that 'file_type' is not included in the result

src/web_interface/rest/rest_statistics.py Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lintly has detected code quality issues in this pull request.

@jstucke jstucke merged commit 294f899 into master Feb 23, 2021
@jstucke jstucke deleted the statistics_endpoint branch February 23, 2021 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants