mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-06 22:18:28 +00:00
Command aptly mirror edit with tests. #63
This commit is contained in:
@@ -0,0 +1 @@
|
||||
Mirror [wheezy-main]: http://mirror.yandex.ru/debian/ wheezy successfully updated.
|
||||
@@ -0,0 +1,22 @@
|
||||
Name: wheezy-main
|
||||
Archive Root URL: http://mirror.yandex.ru/debian/
|
||||
Distribution: wheezy
|
||||
Components: main
|
||||
Architectures: i386, amd64
|
||||
Download Sources: no
|
||||
Filter: nginx
|
||||
Filter With Deps: yes
|
||||
Last update: 2014-06-28 01:23:25 MSK
|
||||
Number of packages: 56121
|
||||
|
||||
Information from release file:
|
||||
Architectures: amd64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel powerpc s390 s390x sparc
|
||||
Codename: wheezy
|
||||
Components: main contrib non-free
|
||||
Date: Sat, 26 Apr 2014 09:27:11 UTC
|
||||
Description: Debian 7.5 Released 26 April 2014
|
||||
|
||||
Label: Debian
|
||||
Origin: Debian
|
||||
Suite: stable
|
||||
Version: 7.5
|
||||
@@ -0,0 +1 @@
|
||||
ERROR: unable to edit: mirror with name wheezy-main not found
|
||||
@@ -0,0 +1 @@
|
||||
Mirror [wheezy-main]: http://mirror.yandex.ru/debian/ wheezy successfully updated.
|
||||
@@ -0,0 +1,20 @@
|
||||
Name: wheezy-main
|
||||
Archive Root URL: http://mirror.yandex.ru/debian/
|
||||
Distribution: wheezy
|
||||
Components: main
|
||||
Architectures: i386, amd64
|
||||
Download Sources: no
|
||||
Last update: 2014-06-28 01:23:25 MSK
|
||||
Number of packages: 56121
|
||||
|
||||
Information from release file:
|
||||
Architectures: amd64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel powerpc s390 s390x sparc
|
||||
Codename: wheezy
|
||||
Components: main contrib non-free
|
||||
Date: Sat, 26 Apr 2014 09:27:11 UTC
|
||||
Description: Debian 7.5 Released 26 April 2014
|
||||
|
||||
Label: Debian
|
||||
Origin: Debian
|
||||
Suite: stable
|
||||
Version: 7.5
|
||||
@@ -0,0 +1 @@
|
||||
ERROR: unable to edit: parsing failed: unexpected token |: expecting field or package name
|
||||
@@ -0,0 +1 @@
|
||||
Mirror [mirror5]: http://security.debian.org/ wheezy/updates successfully updated.
|
||||
@@ -0,0 +1,20 @@
|
||||
Name: mirror5
|
||||
Archive Root URL: http://security.debian.org/
|
||||
Distribution: wheezy/updates
|
||||
Components: main
|
||||
Architectures: amd64, armel, armhf, i386, ia64, kfreebsd-amd64, kfreebsd-i386, mips, mipsel, powerpc, s390, s390x, sparc
|
||||
Download Sources: no
|
||||
Last update: never
|
||||
|
||||
Information from release file:
|
||||
Architectures: amd64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel powerpc s390 s390x sparc
|
||||
Codename: wheezy
|
||||
Components: updates/main updates/contrib updates/non-free
|
||||
Date: Fri, 25 Jul 2014 03:31:55 UTC
|
||||
Description: Debian 7.0 Security Updates
|
||||
|
||||
Label: Debian-Security
|
||||
Origin: Debian
|
||||
Suite: stable
|
||||
Valid-Until: Mon, 04 Aug 2014 03:31:55 UTC
|
||||
Version: 7.0
|
||||
@@ -8,3 +8,4 @@ from .list import *
|
||||
from .update import *
|
||||
from .drop import *
|
||||
from .rename import *
|
||||
from .edit import *
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
from lib import BaseTest
|
||||
|
||||
|
||||
class EditMirror1Test(BaseTest):
|
||||
"""
|
||||
edit mirror: enable filter
|
||||
"""
|
||||
fixtureDB = True
|
||||
runCmd = "aptly mirror edit -filter=nginx -filter-with-deps wheezy-main"
|
||||
|
||||
def check(self):
|
||||
self.check_output()
|
||||
self.check_cmd_output("aptly mirror show wheezy-main", "mirror_show")
|
||||
|
||||
|
||||
class EditMirror2Test(BaseTest):
|
||||
"""
|
||||
edit mirror: missing mirror
|
||||
"""
|
||||
runCmd = "aptly mirror edit wheezy-main"
|
||||
expectedCode = 1
|
||||
|
||||
|
||||
class EditMirror3Test(BaseTest):
|
||||
"""
|
||||
edit mirror: no changes
|
||||
"""
|
||||
fixtureDB = True
|
||||
runCmd = "aptly mirror edit wheezy-main"
|
||||
|
||||
def check(self):
|
||||
self.check_output()
|
||||
self.check_cmd_output("aptly mirror show wheezy-main", "mirror_show")
|
||||
|
||||
|
||||
class EditMirror4Test(BaseTest):
|
||||
"""
|
||||
edit mirror: wrong query
|
||||
"""
|
||||
fixtureDB = True
|
||||
runCmd = "aptly mirror edit -filter=| wheezy-main"
|
||||
expectedCode = 1
|
||||
|
||||
|
||||
class EditMirror5Test(BaseTest):
|
||||
"""
|
||||
edit mirror: remove filter
|
||||
"""
|
||||
fixtureCmds = [
|
||||
"aptly mirror create -ignore-signatures -filter='nginx | Priority (required)' mirror5 http://security.debian.org/ wheezy/updates main",
|
||||
]
|
||||
runCmd = "aptly mirror edit -filter= mirror5"
|
||||
|
||||
def check(self):
|
||||
self.check_output()
|
||||
self.check_cmd_output("aptly mirror show mirror5", "mirror_show")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user