System tests for mirror/repo/snapshot rename commands. #63

This commit is contained in:
Andrey Smirnov
2014-07-26 17:28:16 +04:00
parent c5922737ed
commit b9c8a8d9da
18 changed files with 141 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
Local repo repo1 -> repo2 has been successfully renamed.
@@ -0,0 +1,4 @@
List of local repos:
* [repo2] (packages: 0)
To get more information about local repository, run `aptly repo show <name>`.
+1
View File
@@ -0,0 +1 @@
ERROR: unable to rename: local repo with name repo2 not found
+1
View File
@@ -0,0 +1 @@
ERROR: unable to rename: local repo repo4 already exists
+1
View File
@@ -12,3 +12,4 @@ from .list import *
from .move import *
from .remove import *
from .show import *
from .rename import *
+35
View File
@@ -0,0 +1,35 @@
from lib import BaseTest
class RenameRepo1Test(BaseTest):
"""
rename repo: regular operations
"""
fixtureCmds = [
"aptly repo create repo1",
]
runCmd = "aptly repo rename repo1 repo2"
def check(self):
self.check_output()
self.check_cmd_output("aptly repo list", "repo_list")
class RenameRepo2Test(BaseTest):
"""
rename repo: missing repo
"""
runCmd = "aptly repo rename repo2 repo3"
expectedCode = 1
class RenameRepo3Test(BaseTest):
"""
rename repo: already exists
"""
fixtureCmds = [
"aptly repo create repo3",
"aptly repo create repo4",
]
runCmd = "aptly repo rename repo3 repo4"
expectedCode = 1