diff --git a/system/t09_repo/EditRepo1Test_gold b/system/t09_repo/EditRepo1Test_gold new file mode 100644 index 00000000..38fe2835 --- /dev/null +++ b/system/t09_repo/EditRepo1Test_gold @@ -0,0 +1 @@ +Local repo [repo1]: Lala successfully updated. diff --git a/system/t09_repo/EditRepo1Test_repo-show b/system/t09_repo/EditRepo1Test_repo-show new file mode 100644 index 00000000..10265f58 --- /dev/null +++ b/system/t09_repo/EditRepo1Test_repo-show @@ -0,0 +1,5 @@ +Name: repo1 +Comment: Lala +Default Distribution: +Default Component: main +Number of packages: 0 diff --git a/system/t09_repo/EditRepo2Test_gold b/system/t09_repo/EditRepo2Test_gold new file mode 100644 index 00000000..cda99d7c --- /dev/null +++ b/system/t09_repo/EditRepo2Test_gold @@ -0,0 +1 @@ +Local repo [repo2]: Lala successfully updated. diff --git a/system/t09_repo/EditRepo2Test_repo-show b/system/t09_repo/EditRepo2Test_repo-show new file mode 100644 index 00000000..3b1ad4a7 --- /dev/null +++ b/system/t09_repo/EditRepo2Test_repo-show @@ -0,0 +1,5 @@ +Name: repo2 +Comment: Lala +Default Distribution: wheezy +Default Component: contrib +Number of packages: 0 diff --git a/system/t09_repo/EditRepo3Test_gold b/system/t09_repo/EditRepo3Test_gold new file mode 100644 index 00000000..3d837834 --- /dev/null +++ b/system/t09_repo/EditRepo3Test_gold @@ -0,0 +1 @@ +ERROR: unable to edit: local repo with name repo3 not found diff --git a/system/t09_repo/__init__.py b/system/t09_repo/__init__.py index 7a0d12fc..fb029c46 100644 --- a/system/t09_repo/__init__.py +++ b/system/t09_repo/__init__.py @@ -6,6 +6,7 @@ from .add import * from .copy import * from .create import * from .drop import * +from .edit import * from .cmdimport import * from .list import * from .move import * diff --git a/system/t09_repo/edit.py b/system/t09_repo/edit.py new file mode 100644 index 00000000..075fcf89 --- /dev/null +++ b/system/t09_repo/edit.py @@ -0,0 +1,37 @@ +from lib import BaseTest + + +class EditRepo1Test(BaseTest): + """ + edit repo: change comment + """ + fixtureCmds = [ + "aptly repo create repo1", + ] + runCmd = "aptly repo edit -comment=Lala repo1" + + def check(self): + self.check_output() + self.check_cmd_output("aptly repo show repo1", "repo-show") + + +class EditRepo2Test(BaseTest): + """ + edit repo: change distribution & component + """ + fixtureCmds = [ + "aptly repo create -comment=Lala -component=non-free repo2", + ] + runCmd = "aptly repo edit -distribution=wheezy -component=contrib repo2" + + def check(self): + self.check_output() + self.check_cmd_output("aptly repo show repo2", "repo-show") + + +class EditRepo3Test(BaseTest): + """ + edit repo: no such repo + """ + runCmd = "aptly repo edit repo3" + expectedCode = 1