System tests for aptly repo drop.

This commit is contained in:
Andrey Smirnov
2014-02-26 22:14:18 +04:00
parent 565e82bd1a
commit 85f3d15e8c
7 changed files with 56 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
Local repo `repo1` has been removed.
+1
View File
@@ -0,0 +1 @@
ERROR: unable to show: local repo with name repo1 not found
+3
View File
@@ -0,0 +1,3 @@
Local repo `repo2` was used to create following snapshots:
* [local]: Snapshot from local repo [repo2]
ERROR: won't delete local repo with snapshots, use -force to override
+1
View File
@@ -0,0 +1 @@
Local repo `repo3` has been removed.
+1
View File
@@ -0,0 +1 @@
ERROR: unable to drop: local repo with name repo4 not found
+1
View File
@@ -4,5 +4,6 @@ Testing local repo management
from .add import * from .add import *
from .create import * from .create import *
from .drop import *
from .show import * from .show import *
from .list import * from .list import *
+48
View File
@@ -0,0 +1,48 @@
from lib import BaseTest
class DropRepo1Test(BaseTest):
"""
drop repo: regular drop
"""
fixtureCmds = [
"aptly repo create repo1",
]
runCmd = "aptly repo drop repo1"
def check(self):
self.check_output()
self.check_cmd_output("aptly repo show repo1", "repo-show", expected_code=1)
class DropRepo2Test(BaseTest):
"""
drop repo: in use by snapshots
"""
fixtureCmds = [
"aptly repo create repo2",
"aptly repo add repo2 ${files}",
"aptly snapshot create local from repo repo2",
]
runCmd = "aptly repo drop repo2"
expectedCode = 1
class DropRepo3Test(BaseTest):
"""
drop repo: force
"""
fixtureCmds = [
"aptly repo create repo3",
"aptly repo add repo3 ${files}",
"aptly snapshot create local from repo repo3",
]
runCmd = "aptly repo drop --force repo3"
class DropRepo4Test(BaseTest):
"""
drop repo: no such repo
"""
runCmd = "aptly repo drop repo4"
expectedCode = 1