# -*- coding: utf-8 -*-1"""2Test downloading files3"""4# ****************************************************************************5# Copyright (C) 2015 Volker Braun <[email protected]>6#7# This program is free software: you can redistribute it and/or modify8# it under the terms of the GNU General Public License as published by9# the Free Software Foundation, either version 2 of the License, or10# (at your option) any later version.11# https://www.gnu.org/licenses/12# ****************************************************************************13import unittest1415from .capture import CapturedLog16from sage_bootstrap.download.mirror_list import MirrorList171819class MirrorListTestCase(unittest.TestCase):2021def test_mirror_list(self):22with CapturedLog() as log:23ml = MirrorList()24msg = log.messages()25if msg:26self.assertEqual(msg[0],27('INFO', 'Downloading the Sage mirror list'))28self.assertGreaterEqual(len(ml.mirrors), 0)29self.assertTrue(30ml.fastest.startswith('http://') or31ml.fastest.startswith('https://') or32ml.fastest.startswith('ftp://')33)343536