diff --git a/tests/mirrors.conf b/tests/mirrors.conf new file mode 100644 index 00000000..230fa477 --- /dev/null +++ b/tests/mirrors.conf @@ -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/ diff --git a/tests/mirrorstest.py b/tests/mirrorstest.py new file mode 100644 index 00000000..846c2ef2 --- /dev/null +++ b/tests/mirrorstest.py @@ -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") diff --git a/tests/runtests.py b/tests/runtests.py index d95b65c6..b2fa09ea 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -22,6 +22,7 @@ from database.filesdbtest import FilesDBTestCase from database.lazydbtest import LazyDBTestCase from database.itembyrepotest import ItemByRepoTestCase from versiontest import VersionTestCase +from mirrorstest import MirrorsTestCase suite = unittest.TestSuite()