add mirrors.conf test

This commit is contained in:
Beyza Ermiş
2008-06-20 13:14:53 +00:00
parent 0d948c12a0
commit fcd4e0c8ec
3 changed files with 25 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
apache http://www.eu.apache.org/dist/
cpan http://search.cpan.org/CPAN/
cpan http://cpan.ulak.net.tr/
gnu http://ftp.gnu.org/gnu/
+20
View File
@@ -0,0 +1,20 @@
# Copyright (C) 2008, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# Please read the COPYING file.
#
import unittest
from pisi.mirrors import Mirrors
class MirrorsTestCase(unittest.TestCase):
def testGetMirrors(self):
mirrors = Mirrors("mirrors.conf")
assert ["http://www.eu.apache.org/dist/"] == mirrors.get_mirrors("apache")
assert ['http://search.cpan.org/CPAN/', 'http://cpan.ulak.net.tr/'] == mirrors.get_mirrors("cpan")
assert ["http://ftp.gnu.org/gnu/"] == mirrors.get_mirrors("gnu")
+1
View File
@@ -22,6 +22,7 @@ from database.filesdbtest import FilesDBTestCase
from database.lazydbtest import LazyDBTestCase from database.lazydbtest import LazyDBTestCase
from database.itembyrepotest import ItemByRepoTestCase from database.itembyrepotest import ItemByRepoTestCase
from versiontest import VersionTestCase from versiontest import VersionTestCase
from mirrorstest import MirrorsTestCase
suite = unittest.TestSuite() suite = unittest.TestSuite()