launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #33064
[Merge] ~ines-almeida/launchpad:svt-fix-export-tests into launchpad:master
Ines Almeida has proposed merging ~ines-almeida/launchpad:svt-fix-export-tests into launchpad:master.
Commit message:
Fix unit tests related to SVT exporter
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~ines-almeida/launchpad/+git/launchpad/+merge/493522
Missed a few tests that were out of the `bugs/scripts/tests`. This should fix the tests that failed according to http://lpbuildbot.canonical.com/builders/lp-devel-focal/builds/1161/steps/shell/logs/summary
I'm also re-running all tests in bugs directory to check
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~ines-almeida/launchpad:svt-fix-export-tests into launchpad:master.
diff --git a/lib/lp/bugs/model/tests/test_vulnerability.py b/lib/lp/bugs/model/tests/test_vulnerability.py
index de73b01..b7e940e 100644
--- a/lib/lp/bugs/model/tests/test_vulnerability.py
+++ b/lib/lp/bugs/model/tests/test_vulnerability.py
@@ -1650,7 +1650,6 @@ class TestVulnerabilityGetJobs(TestCaseWithFactory):
job = getUtility(IExportVulnerabilityJobSource).create(
handler=VulnerabilityHandlerEnum.SOSS,
- information_type=InformationType.PRIVATESECURITY.value,
)
return job
diff --git a/lib/lp/bugs/tests/test_exportvulnerabilityjob.py b/lib/lp/bugs/tests/test_exportvulnerabilityjob.py
index 98cfc98..1d8ea25 100644
--- a/lib/lp/bugs/tests/test_exportvulnerabilityjob.py
+++ b/lib/lp/bugs/tests/test_exportvulnerabilityjob.py
@@ -58,12 +58,10 @@ class ExportVulnerabilityJobTests(TestCaseWithFactory):
def test___repr__(self):
"""Test __repr__ method."""
handler = VulnerabilityHandlerEnum.SOSS
- information_type = InformationType.PRIVATESECURITY.value
metadata = {
"request": {
"sources": [],
- "information_type": information_type,
},
"result": {
"error_description": [],
@@ -75,9 +73,7 @@ class ExportVulnerabilityJobTests(TestCaseWithFactory):
},
}
- job = self.job_source.create(
- handler, information_type=information_type
- )
+ job = self.job_source.create(handler)
expected = (
"<ExportVulnerabilityJob for "
@@ -162,12 +158,10 @@ class ExportVulnerabilityJobTests(TestCaseWithFactory):
be gotten out again."""
handler = VulnerabilityHandlerEnum.SOSS
- information_type = InformationType.PRIVATESECURITY.value
metadata = {
"request": {
"sources": ["https://launchpad.net/ubuntu"],
- "information_type": information_type,
},
"result": {
"error_description": [],
@@ -182,7 +176,6 @@ class ExportVulnerabilityJobTests(TestCaseWithFactory):
job = self.job_source.create(
handler,
sources=["https://launchpad.net/ubuntu"],
- information_type=information_type,
)
naked_job = removeSecurityProxy(job)
@@ -239,7 +232,6 @@ class ExportVulnerabilityJobTests(TestCaseWithFactory):
def test_run_export(self):
"""Run ExportVulnerabilityJob."""
imported_list = self._put_cve_in_soss()
- information_type = InformationType.PRIVATESECURITY.value
export_link = "http://example.com/fake-url"
self.patch(
@@ -250,7 +242,6 @@ class ExportVulnerabilityJobTests(TestCaseWithFactory):
job = self.job_source.create(
handler=VulnerabilityHandlerEnum.SOSS,
- information_type=information_type,
)
job.run()
@@ -268,7 +259,6 @@ class ExportVulnerabilityJobTests(TestCaseWithFactory):
{
"request": {
"sources": [],
- "information_type": information_type,
},
"result": {
"error_description": [],
@@ -300,23 +290,15 @@ class ExportVulnerabilityJobTests(TestCaseWithFactory):
"""The ExportVulnerabilityJob.error_description property returns
None when no error description is recorded."""
handler = VulnerabilityHandlerEnum.SOSS
- information_type = InformationType.PRIVATESECURITY.value
- job = self.job_source.create(
- handler,
- information_type=information_type,
- )
+ job = self.job_source.create(handler)
self.assertEqual([], removeSecurityProxy(job).error_description)
def test_error_description_set_when_notifying_about_user_errors(self):
"""Test that error_description is set by notifyUserError()."""
handler = VulnerabilityHandlerEnum.SOSS
- information_type = InformationType.PRIVATESECURITY.value
- job = self.job_source.create(
- handler,
- information_type=information_type,
- )
+ job = self.job_source.create(handler)
message = "This is an example message."
job.notifyUserError(VulnerabilityJobException(message))
self.assertEqual([message], removeSecurityProxy(job).error_description)
@@ -375,12 +357,8 @@ class ExportVulnerabilityTestViaCelery(TestCaseWithFactory):
job_source = getUtility(IExportVulnerabilityJobSource)
handler = VulnerabilityHandlerEnum.SOSS
- information_type = InformationType.PRIVATESECURITY.value
with block_on_job():
- job_source.create(
- handler,
- information_type=information_type,
- )
+ job_source.create(handler)
transaction.commit()
cve_names = [
@@ -395,7 +373,6 @@ class ExportVulnerabilityTestViaCelery(TestCaseWithFactory):
metadata_request = {
"sources": [],
- "information_type": information_type,
}
metadata_result = {