System test for aptly snapshot create empty.

This commit is contained in:
Andrey Smirnov
2014-02-07 13:28:09 +04:00
parent 919dc53814
commit 9dccf2a4ee
4 changed files with 31 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
Snapshot snap4 successfully created.
You can run 'aptly publish snapshot snap4' to publish snapshot as Debian repository.

View File

@@ -0,0 +1,4 @@
Name: snap4
Description: Created as empty
Number of packages: 0
Packages:

View File

@@ -0,0 +1 @@
ERROR: unable to add snapshot: snapshot with name snap5 already exists

View File

@@ -34,3 +34,26 @@ class CreateSnapshot3Test(BaseTest):
fixtureCmds = ["aptly snapshot create snap1 from mirror wheezy-main"]
runCmd = "aptly snapshot create snap1 from mirror wheezy-contrib"
expectedCode = 1
class CreateSnapshot4Test(BaseTest):
"""
create snapshot: empty
"""
runCmd = "aptly snapshot create snap4 empty"
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 snap4", "snapshot_show", match_prepare=remove_created_at)
class CreateSnapshot5Test(BaseTest):
"""
create snapshot: empty duplicate name
"""
fixtureCmds = ["aptly snapshot create snap5 empty"]
runCmd = "aptly snapshot create snap5 empty"
expectedCode = 1