Enrique Sánchez has proposed merging 
~enriqueesanchz/launchpad:add-import-export-endpoints into launchpad:master.

Commit message:
Fix Vulnerability custom exception tests
Fix checkCommitInRef interface arguments

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~enriqueesanchz/launchpad/+git/launchpad/+merge/491667
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of 
~enriqueesanchz/launchpad:add-import-export-endpoints into launchpad:master.
diff --git a/lib/lp/bugs/model/tests/test_vulnerability.py b/lib/lp/bugs/model/tests/test_vulnerability.py
index ebec6c7..adc0f6b 100644
--- a/lib/lp/bugs/model/tests/test_vulnerability.py
+++ b/lib/lp/bugs/model/tests/test_vulnerability.py
@@ -11,6 +11,8 @@ from zope.security.proxy import removeSecurityProxy
 
 from lp.app.enums import InformationType
 from lp.app.errors import (
+    IncompatibleArguments,
+    NotFoundError,
     SubscriptionPrivacyViolation,
     UserCannotUnsubscribePerson,
 )
@@ -801,7 +803,7 @@ class TestVulnerabilitySetImportData(TestCaseWithFactory):
         information_type = InformationType.PUBLIC
         with person_logged_in(self.requester):
             self.assertRaisesWithContent(
-                ValueError,
+                IncompatibleArguments,
                 "information_type must be PRIVATE when importing from a "
                 "private git repository",
                 getUtility(IVulnerabilitySet).importData,
@@ -834,8 +836,9 @@ class TestVulnerabilitySetImportData(TestCaseWithFactory):
 
         with person_logged_in(self.requester):
             self.assertRaisesWithContent(
-                ValueError,
-                "wrong-git-ref does not exist in the specified git repository",
+                NotFoundError,
+                "'wrong-git-ref does not exist in the specified git "
+                "repository'",
                 getUtility(IVulnerabilitySet).importData,
                 self.requester,
                 self.handler,
@@ -867,9 +870,9 @@ class TestVulnerabilitySetImportData(TestCaseWithFactory):
         import_since_commit_sha1 = "1" * 40
         with person_logged_in(self.requester):
             self.assertRaisesWithContent(
-                ValueError,
-                f"{import_since_commit_sha1} does not exist in "
-                f"{self.git_ref}",
+                NotFoundError,
+                f"'{import_since_commit_sha1} does not exist in "
+                f"{self.git_ref}'",
                 getUtility(IVulnerabilitySet).importData,
                 self.requester,
                 self.handler,
diff --git a/lib/lp/code/interfaces/gitrepository.py b/lib/lp/code/interfaces/gitrepository.py
index f8bd045..86cf227 100644
--- a/lib/lp/code/interfaces/gitrepository.py
+++ b/lib/lp/code/interfaces/gitrepository.py
@@ -770,8 +770,11 @@ class IGitRepositoryView(IHasRecipes, IAccessTokenTarget):
         "yet been scanned."
     )
 
-    def checkCommitInRef(paths):
-        """Check if a commit exists in a git ref."""
+    def checkCommitInRef(commit, ref):
+        """Check if a commit exists in a git ref.
+        :param commit: the commit sha1 to look for.
+        :param ref: the git reference path where it will look.
+        """
 
     def updateMergeCommitIDs(paths):
         """Update commit SHA1s of merge proposals for this repository.
_______________________________________________
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to     : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp

Reply via email to