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

Fix get_scanner_details(). #210

Merged
merged 2 commits into from
Feb 19, 2020
Merged

Fix get_scanner_details(). #210

merged 2 commits into from
Feb 19, 2020

Conversation

jjnicola
Copy link
Member

Running the test with python3 -m setup.py tests, a test was failing
while running with python3 -m unittest, it doesn't.

The scanner_params variable was overwritten with the xml Element and
passed dictionary was lost.

A second issue was the et.Element type. isinstance() in xml.simple_response_str()
does not recognize et.Element as Element, and therefore the parameter was not added to the final
response. For this reason, Element is used in protocol instead of et.Element.

Running the test with python3 -m setup.py tests, a test was failing
while running with python3 -m unittest, it doesn't.

The scanner_params variable was overwritten with the xml Element and
passed dictionary was lost.

A second issue was the et.Element type. isinstance() in xml.simple_response_str()
does not recognize et.Element as Element, and therefore the parameter was not added to the final
response. For this reason, Element is used in protocol instead of et.Element.
@codecov
Copy link

codecov bot commented Feb 19, 2020

Codecov Report

Merging #210 into master will increase coverage by 0.28%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #210      +/-   ##
==========================================
+ Coverage   73.23%   73.52%   +0.28%     
==========================================
  Files          18       18              
  Lines        2130     2130              
==========================================
+ Hits         1560     1566       +6     
+ Misses        570      564       -6
Impacted Files Coverage Δ
ospd/protocol.py 95% <100%> (+7.5%) ⬆️

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 cd4f3ff...a287ae2. Read the comment docs.

@jjnicola jjnicola merged commit fa86a5e into greenbone:master Feb 19, 2020
@jjnicola jjnicola deleted the params branch February 19, 2020 10:25
@bjoernricks
Copy link
Contributor

Sorry for breaking the scanner details. It seems for unknown reasons

from xml.etree.ElementTree as et
et.Element

seems to be not the same as

from xml.etree.ElemenTree import Element

i''ve already observed this but did thought it was cause by something else.

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.

3 participants