Merge ~sbeattie/ubuntu-cve-tracker/+git/ubuntu-cve-tracker:publish-cves-notes-test-json into ubuntu-cve-tracker:master
Status: | Merged |
---|---|
Merged at revision: | c0ddff552cd8fd498129542068e16aa450628965 |
Proposed branch: | ~sbeattie/ubuntu-cve-tracker/+git/ubuntu-cve-tracker:publish-cves-notes-test-json |
Merge into: | ubuntu-cve-tracker:master |
Diff against target: |
534 lines (+333/-139) 8 files modified
scripts/publish-cves-to-website-api.py (+3/-2) test/website_api/use_esm_status_for_eol_releases.json (+45/-25) test/website_api/use_esm_status_if_esm_release.json (+57/-33) test/website_api/use_notes (+27/-0) test/website_api/use_notes.json (+60/-0) test/website_api/use_public_status_for_no_eol_releases.json (+45/-25) test/website_api/use_public_status_if_public_release.json (+51/-29) test/website_api/use_ros-esm_status.json (+45/-25) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alex Murray | Approve | ||
Review via email: mp+448958@code.launchpad.net |
Commit message
publish-
As part of developing testcases for the merge request
https:/
I added a testcase that added notes field, and discovered that the pprint() output is not guaranteed to be valid json.
This pull request adds a basic notes field test along with the invalid json example output generated by the publish-
(The output is not actually valid json, because a summary statement is prepended to the output, invaldiating it, but the tests end up discarding that.)
Steve Beattie (2):
* [0f33dc25a92] publish-
* [91180197a70] publish-
Description of the change
This is how the scripts/
=======
collected 6 items
scripts/
_public_release] PASSED [ 16%]
scripts/
m_release] PASSED [ 33%]
scripts/
r_no_eol_releases] PASSED [ 50%]
scripts/
PASSED [ 66%]
scripts/
ol_releases] PASSED [ 83%]
scripts/
00%]
=======
_______
self = <test_publish-
cve_test_file = 'use_notes'
@pytest.
def test_simple_
> self.__
scripts/
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
scripts/
payload_json = json.load(f)
/usr/lib/
return loads(fp.read(),
/usr/lib/
return _default_
/usr/lib/
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <json.decoder.
s = '[{"bugs": [""],\n "cvss3": null,\n "description": "\\nPublish CVEs to Website API tests",\n
"id": "CVE-2020-
\n "tags": {},\n "ubuntu_
idx = 0
def raw_decode(self, s, idx=0):
"""Decode a JSON document from ``s`` (a ``str`` beginning with
a JSON document) and return a 2-tuple of the Python
This can be used to decode a JSON document from a string that may
have extraneous data at the end.
"""
try:
> obj, end = self.scan_once(s, idx)
E json.decoder.
/usr/lib/
-------
1 total CVEs
=======
FAILED scripts/
json.decoder.
=======
LGTM! - thanks Steve.