System tests for aptly repo remove.

This commit is contained in:
Andrey Smirnov
2014-02-27 16:22:18 +04:00
parent 07cf61a641
commit 0549db6833
7 changed files with 66 additions and 1 deletions

View File

@@ -0,0 +1,4 @@
Loading packages...
[-] pyspi_0.6.1-1.3_source removed
[-] pyspi_0.6.1-1.4_source removed

View File

@@ -0,0 +1,5 @@
Name: local-repo
Comment: Cool
Number of packages: 1
Packages:
libboost-program-options-dev_1.49.0.1_i386

View File

@@ -0,0 +1,4 @@
Loading packages...
[-] libboost-program-options-dev_1.49.0.1_i386 removed
[-] pyspi_0.6.1-1.4_source removed

View File

@@ -0,0 +1,5 @@
Name: local-repo
Comment: Cool
Number of packages: 1
Packages:
pyspi_0.6.1-1.3_source

View File

@@ -0,0 +1 @@
ERROR: unable to remove: local repo with name local-repo not found

View File

@@ -5,5 +5,6 @@ Testing local repo management
from .add import *
from .create import *
from .drop import *
from .show import *
from .list import *
from .remove import *
from .show import *

45
system/t09_repo/remove.py Normal file
View File

@@ -0,0 +1,45 @@
from lib import BaseTest
class RemoveRepo1Test(BaseTest):
"""
remvoe from local repo: as dep
"""
fixtureCmds = [
"aptly repo create -comment=Cool local-repo",
"aptly repo add local-repo ${files}"
]
runCmd = "aptly repo remove local-repo pyspi some"
def check(self):
self.check_output()
self.check_cmd_output("aptly repo show -with-packages local-repo", "repo_show")
def output_processor(self, output):
return "\n".join(sorted(output.split("\n")))
class RemoveRepo2Test(BaseTest):
"""
remvoe from local repo: as dep with version, key
"""
fixtureCmds = [
"aptly repo create -comment=Cool local-repo",
"aptly repo add local-repo ${files}"
]
runCmd = "aptly repo remove local-repo 'pyspi (>> 0.6.1-1.3)' libboost-program-options-dev_1.49.0.1_i386"
def check(self):
self.check_output()
self.check_cmd_output("aptly repo show -with-packages local-repo", "repo_show")
def output_processor(self, output):
return "\n".join(sorted(output.split("\n")))
class RemoveRepo3Test(BaseTest):
"""
remvoe from local repo: no such repo
"""
runCmd = "aptly repo remove local-repo 'pyspi (>> 0.6.1-1.3)' libboost-program-options-dev_1.49.0.1_i386"
expectedCode = 1