-
Notifications
You must be signed in to change notification settings - Fork 10
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
Bug fixes: anticipating None values #17
base: master
Are you sure you want to change the base?
Bug fixes: anticipating None values #17
Conversation
Kudos, SonarCloud Quality Gate passed! |
If one CPT misses some or the entire required data, it shouldn't get populated with the data from the previously read CPT. Test 1 - The first CPT contains data, but it is not read. Then, the second CPT does not get populated with data. from geolib_plus.bro_xml_cpt import BroXmlCpt
import os
from pathlib import Path
out_dir = r""
cpt_xml1 = os.path.join(out_dir,"CPT000000038970"+".xml")
cpt_xml2 = os.path.join(out_dir,'CPT000000089280'+".xml")
# cpt_data1 = BroXmlCpt()
# cpt_data1.read(Path(cpt_xml1))
cpt_data2 = BroXmlCpt()
cpt_data2.read(Path(cpt_xml2))
# print(f"cpt_data1.depth {cpt_data1.depth is None}")
print(f"cpt_data2.depth {cpt_data2.depth is None}") Output:
Test 2 - The first CPT contains data and it is read. Because of that, the second CPT - which is supposed to be empty, gets populated with data. from geolib_plus.bro_xml_cpt import BroXmlCpt
import os
from pathlib import Path
out_dir = r""
cpt_xml1 = os.path.join(out_dir,"CPT000000038970"+".xml")
cpt_xml2 = os.path.join(out_dir,'CPT000000089280'+".xml")
cpt_data1 = BroXmlCpt()
cpt_data1.read(Path(cpt_xml1))
cpt_data2 = BroXmlCpt()
cpt_data2.read(Path(cpt_xml2))
print(f"cpt_data1.depth {cpt_data1.depth is None}")
print(f"cpt_data2.depth {cpt_data2.depth is None}") Output
|
Could you add the code you appended above as a unit test? |
Thanks for your changes and writing a unit test! |
Kudos, SonarCloud Quality Gate passed! |
Anticipating None values. Before, we were getting errors.