Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sage
Path: blob/develop/build/test/test_mirror_list.py
4055 views
1
# -*- coding: utf-8 -*-
2
"""
3
Test downloading files
4
"""
5
# ****************************************************************************
6
# Copyright (C) 2015 Volker Braun <[email protected]>
7
#
8
# This program is free software: you can redistribute it and/or modify
9
# it under the terms of the GNU General Public License as published by
10
# the Free Software Foundation, either version 2 of the License, or
11
# (at your option) any later version.
12
# https://www.gnu.org/licenses/
13
# ****************************************************************************
14
import unittest
15
16
from .capture import CapturedLog
17
from sage_bootstrap.download.mirror_list import MirrorList
18
19
20
class MirrorListTestCase(unittest.TestCase):
21
22
def test_mirror_list(self):
23
with CapturedLog() as log:
24
ml = MirrorList()
25
msg = log.messages()
26
if msg:
27
self.assertEqual(msg[0],
28
('INFO', 'Downloading the Sage mirror list'))
29
self.assertGreaterEqual(len(ml.mirrors), 0)
30
self.assertTrue(
31
ml.fastest.startswith('http://') or
32
ml.fastest.startswith('https://') or
33
ml.fastest.startswith('ftp://')
34
)
35
36