Skip to content
This repository has been archived by the owner on Nov 29, 2021. It is now read-only.

Use an iterator to get the vts when get_vts cmd is called #216

Merged
merged 6 commits into from
Mar 4, 2020

Conversation

jjnicola
Copy link
Member

@jjnicola jjnicola commented Mar 2, 2020

No description provided.

@codecov
Copy link

codecov bot commented Mar 2, 2020

Codecov Report

Merging #216 into master will increase coverage by 0.05%.
The diff coverage is 92.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #216      +/-   ##
==========================================
+ Coverage   73.66%   73.71%   +0.05%     
==========================================
  Files          18       18              
  Lines        2119     2127       +8     
==========================================
+ Hits         1561     1568       +7     
- Misses        558      559       +1
Impacted Files Coverage Δ
ospd/vts.py 94.38% <100%> (+0.12%) ⬆️
ospd/ospd.py 74.72% <100%> (+0.09%) ⬆️
ospd/command/command.py 87.09% <80%> (-0.16%) ⬇️

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 7b65ac1...b73f8cc. Read the comment docs.

@codecov
Copy link

codecov bot commented Mar 2, 2020

Codecov Report

Merging #216 into master will increase coverage by 0.05%.
The diff coverage is 93.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #216      +/-   ##
==========================================
+ Coverage   73.66%   73.71%   +0.05%     
==========================================
  Files          18       18              
  Lines        2119     2127       +8     
==========================================
+ Hits         1561     1568       +7     
- Misses        558      559       +1
Impacted Files Coverage Δ
ospd/vts.py 94.38% <100%> (+0.12%) ⬆️
ospd/ospd.py 74.72% <100%> (+0.09%) ⬆️
ospd/command/command.py 87.09% <80%> (-0.16%) ⬇️

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 7b65ac1...c403802. Read the comment docs.

ospd/ospd.py Outdated Show resolved Hide resolved
ospd/vts.py Outdated Show resolved Hide resolved
@@ -546,7 +546,6 @@ def test_scan_with_error(self):
)
response = fs.get_response()
scan_id = response.findtext('id')
print(scan_id)
Copy link
Contributor

Choose a reason for hiding this comment

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

Ups...

Copy link
Contributor

@bjoernricks bjoernricks left a comment

Choose a reason for hiding this comment

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

I've updated the pr just a little bit now to make the types more strict and obvious.

ospd/vts.py Outdated Show resolved Hide resolved
ospd/vts.py Outdated
Comment on lines 56 to 58
def items(self):
return self.vts.items()

Copy link
Contributor

Choose a reason for hiding this comment

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

IMHO we can ensure that items already returns an iterator.

Suggested change
def items(self):
return self.vts.items()
def items(self) -> Iterator[Tuple[str, str]]:
return iter(self.vts.items())

ospd/ospd.py Outdated
Comment on lines 944 to 947
def get_vt_iterator(self) -> Iterable:
""" Return iterator object for getting elements
from the VTs dictionary. """
return iter(self.vts.items())
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def get_vt_iterator(self) -> Iterable:
""" Return iterator object for getting elements
from the VTs dictionary. """
return iter(self.vts.items())
def get_vt_iterator(self) -> Iterator[Tuple[str,str]]:
""" Return iterator object for getting elements
from the VTs dictionary. """
return self.vts.items()

@jjnicola jjnicola merged commit 5170464 into greenbone:master Mar 4, 2020
@jjnicola jjnicola deleted the vts-iter branch March 4, 2020 11:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants