mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-08 05:50:47 +00:00
Command aptly mirror drop with system tests.
This commit is contained in:
+2
-2
@@ -104,8 +104,8 @@ class BaseTest(object):
|
||||
def check_output(self):
|
||||
self.verify_match(self.get_gold(), self.output, match_prepare=self.outputMatchPrepare)
|
||||
|
||||
def check_cmd_output(self, command, gold_name, match_prepare=None):
|
||||
self.verify_match(self.get_gold(gold_name), self.run_cmd(command), match_prepare)
|
||||
def check_cmd_output(self, command, gold_name, match_prepare=None, expected_code=0):
|
||||
self.verify_match(self.get_gold(gold_name), self.run_cmd(command, expected_code=expected_code), match_prepare)
|
||||
|
||||
def verify_match(self, a, b, match_prepare=None):
|
||||
if match_prepare is not None:
|
||||
|
||||
@@ -3,6 +3,7 @@ aptly mirror - manage mirrors of remote repositories
|
||||
Commands:
|
||||
|
||||
create create new mirror of Debian repository
|
||||
drop delete remote repository mirror
|
||||
list list mirrors of remote repositories
|
||||
show show details about remote repository mirror
|
||||
update update packages from remote mirror
|
||||
|
||||
@@ -3,6 +3,7 @@ aptly mirror - manage mirrors of remote repositories
|
||||
Commands:
|
||||
|
||||
create create new mirror of Debian repository
|
||||
drop delete remote repository mirror
|
||||
list list mirrors of remote repositories
|
||||
show show details about remote repository mirror
|
||||
update update packages from remote mirror
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Mirror `mirror1` has been removed.
|
||||
@@ -0,0 +1 @@
|
||||
ERROR: unable to show: mirror with name mirror1 not found
|
||||
@@ -0,0 +1,3 @@
|
||||
Mirror `wheezy-main` was used to create following snapshots:
|
||||
* [wheez]: Snapshot from mirror [wheezy-main]: http://mirror.yandex.ru/debian/ wheezy
|
||||
ERROR: won't delete mirror with snapshots, use --force to override
|
||||
@@ -0,0 +1 @@
|
||||
Mirror `wheezy-main` has been removed.
|
||||
@@ -0,0 +1 @@
|
||||
ERROR: unable to drop: mirror with name mirror1 not found
|
||||
@@ -6,3 +6,4 @@ from .create import *
|
||||
from .show import *
|
||||
from .list import *
|
||||
from .update import *
|
||||
from .drop import *
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
from lib import BaseTest
|
||||
|
||||
|
||||
class DropMirror1Test(BaseTest):
|
||||
"""
|
||||
drop mirror: regular list
|
||||
"""
|
||||
fixtureCmds = [
|
||||
"aptly mirror create mirror1 http://mirror.yandex.ru/debian/ wheezy",
|
||||
]
|
||||
runCmd = "aptly mirror drop mirror1"
|
||||
|
||||
def check(self):
|
||||
self.check_output()
|
||||
self.check_cmd_output("aptly mirror show mirror1", "mirror_show", expected_code=1)
|
||||
|
||||
|
||||
class DropMirror2Test(BaseTest):
|
||||
"""
|
||||
drop mirror: in use by snapshots
|
||||
"""
|
||||
fixtureDB = True
|
||||
fixtureCmds = [
|
||||
"aptly snapshot create wheez from mirror wheezy-main"
|
||||
]
|
||||
runCmd = "aptly mirror drop wheezy-main"
|
||||
expectedCode = 1
|
||||
|
||||
|
||||
class DropMirror3Test(BaseTest):
|
||||
"""
|
||||
drop mirror: force
|
||||
"""
|
||||
fixtureDB = True
|
||||
fixtureCmds = [
|
||||
"aptly snapshot create wheez from mirror wheezy-main"
|
||||
]
|
||||
runCmd = "aptly mirror drop --force wheezy-main"
|
||||
|
||||
|
||||
class DropMirror4Test(BaseTest):
|
||||
"""
|
||||
drop mirror: no such mirror
|
||||
"""
|
||||
runCmd = "aptly mirror drop mirror1"
|
||||
expectedCode = 1
|
||||
Reference in New Issue
Block a user