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
@@ -0,0 +1,2 @@
Snapshot snapshot1 -> snapshot2 has been successfully renamed.
@@ -0,0 +1,4 @@
List of snapshots:
* [snapshot2]: Snapshot from mirror [wheezy-contrib]: http://mirror.yandex.ru/debian/ wheezy
To get more information about snapshot, run `aptly snapshot show <name>`.
@@ -0,0 +1 @@
ERROR: unable to rename: snapshot with name snapshot2 not found
@@ -0,0 +1 @@
ERROR: unable to rename: snapshot snapshot4 already exists
+1
View File
@@ -10,3 +10,4 @@ from .pull import *
from .diff import *
from .merge import *
from .drop import *
from .rename import *
+37
View File
@@ -0,0 +1,37 @@
from lib import BaseTest
class RenameSnapshot1Test(BaseTest):
"""
rename snapshot: regular operations
"""
fixtureDB = True
fixtureCmds = [
"aptly snapshot create snapshot1 from mirror wheezy-contrib",
]
runCmd = "aptly snapshot rename snapshot1 snapshot2"
def check(self):
self.check_output()
self.check_cmd_output("aptly snapshot list", "snapshot_list")
class RenameSnapshot2Test(BaseTest):
"""
rename snapshot: missing snapshot
"""
runCmd = "aptly snapshot rename snapshot2 snapshot3"
expectedCode = 1
class RenameSnapshot3Test(BaseTest):
"""
rename snapshot: already exists
"""
fixtureDB = True
fixtureCmds = [
"aptly snapshot create snapshot3 from mirror wheezy-contrib",
"aptly snapshot create snapshot4 from mirror wheezy-contrib",
]
runCmd = "aptly snapshot rename snapshot3 snapshot4"
expectedCode = 1