Files
aptly/system/t05_snapshot/search.py
T
2014-08-28 19:07:39 +04:00

40 lines
1.1 KiB
Python

from lib import BaseTest
class SearchSnapshot1Test(BaseTest):
"""
search snapshot: regular search
"""
fixtureDB = True
outputMatchPrepare = lambda _, s: "\n".join(sorted(s.split("\n")))
fixtureCmds = ["aptly snapshot create wheezy-main from mirror wheezy-main"]
runCmd = "aptly snapshot search wheezy-main '$$Architecture (i386), Name (% *-dev)'"
class SearchSnapshot2Test(BaseTest):
"""
search snapshot: missing snapshot
"""
runCmd = "aptly snapshot search snapshot-xx 'Name'"
expectedCode = 1
class SearchSnapshot3Test(BaseTest):
"""
search snapshot: wrong expression
"""
fixtureDB = True
fixtureCmds = ["aptly snapshot create wheezy-main from mirror wheezy-main"]
expectedCode = 1
runCmd = "aptly snapshot search wheezy-main '$$Architecture (i386'"
class SearchSnapshot4Test(BaseTest):
"""
search snapshot: with-deps search
"""
fixtureDB = True
fixtureCmds = ["aptly snapshot create wheezy-main from mirror wheezy-main"]
outputMatchPrepare = lambda _, s: "\n".join(sorted(s.split("\n")))
runCmd = "aptly snapshot search -with-deps wheezy-main 'Name (nginx)'"