Command aptly mirror edit with tests. #63

This commit is contained in:
Andrey Smirnov
2014-07-26 17:59:46 +04:00
parent b9c8a8d9da
commit 8649ee3b37
14 changed files with 196 additions and 0 deletions
+1
View File
@@ -4,6 +4,7 @@ Commands:
create create new mirror
drop delete mirror
edit edit properties of mirorr
list list mirrors
rename renames mirror
show show details about mirror
+1
View File
@@ -4,6 +4,7 @@ Commands:
create create new mirror
drop delete mirror
edit edit properties of mirorr
list list mirrors
rename renames mirror
show show details about mirror
+1
View File
@@ -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
+1
View File
@@ -0,0 +1 @@
ERROR: unable to edit: mirror with name wheezy-main not found
+1
View File
@@ -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
+1
View File
@@ -0,0 +1 @@
ERROR: unable to edit: parsing failed: unexpected token |: expecting field or package name
+1
View File
@@ -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
+1
View File
@@ -8,3 +8,4 @@ from .list import *
from .update import *
from .drop import *
from .rename import *
from .edit import *
+58
View File
@@ -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")