Tests for aptly snapshot create from repo

This commit is contained in:
Andrey Smirnov
2014-02-26 21:17:10 +04:00
parent f19a334b2b
commit df811ff36a
5 changed files with 51 additions and 0 deletions
@@ -0,0 +1,3 @@
Snapshot snap6 successfully created.
You can run 'aptly publish snapshot snap6' to publish snapshot as Debian repository.
@@ -0,0 +1,7 @@
Name: snap6
Description: Snapshot from local repo [local-repo]
Number of packages: 3
Packages:
libboost-program-options-dev-1.49.0.1_i386
pyspi-0.6.1-1.3_source
pyspi-0.6.1-1.4_source
@@ -0,0 +1 @@
ERROR: unable to create snapshot: local repo with name no-such-repo not found
@@ -0,0 +1 @@
ERROR: unable to add snapshot: snapshot with name snap8 already exists
+39
View File
@@ -57,3 +57,42 @@ class CreateSnapshot5Test(BaseTest):
fixtureCmds = ["aptly snapshot create snap5 empty"]
runCmd = "aptly snapshot create snap5 empty"
expectedCode = 1
class CreateSnapshot6Test(BaseTest):
"""
create snapshot: from repo
"""
fixtureCmds = [
"aptly repo create local-repo",
"aptly repo add local-repo ${files}"
]
runCmd = "aptly snapshot create snap6 from repo local-repo"
def check(self):
def remove_created_at(s):
return re.sub(r"Created At: [0-9:A-Za-z -]+\n", "", s)
self.check_output()
self.check_cmd_output("aptly snapshot show -with-packages snap6", "snapshot_show", match_prepare=remove_created_at)
class CreateSnapshot7Test(BaseTest):
"""
create snapshot: no repo
"""
runCmd = "aptly snapshot create snap1 from repo no-such-repo"
expectedCode = 1
class CreateSnapshot8Test(BaseTest):
"""
create snapshot: duplicate name from repo
"""
fixtureCmds = [
"aptly repo create local-repo",
"aptly repo add local-repo ${files}",
"aptly snapshot create snap8 from repo local-repo"
]
runCmd = "aptly snapshot create snap8 from repo local-repo"
expectedCode = 1