# This program is free software; you can redistribute it and/or modify1# it under the terms of the GNU General Public License as published by2# the Free Software Foundation; either version 2 of the License, or3# (at your option) any later version.4#5# This program is distributed in the hope that it will be useful,6# but WITHOUT ANY WARRANTY; without even the implied warranty of7# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the8# GNU General Public License for more details.9#10# You should have received a copy of the GNU General Public License11# along with this program; if not, write to the Free Software12# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,13# MA 02110-1301, USA.14#15# Author: Mauro Soria1617from unittest import TestCase1819from lib.core.settings import DUMMY_DOMAIN20from lib.utils.schemedet import detect_scheme212223class TestSchemedet(TestCase):24def test_detect_scheme(self):25self.assertEqual(detect_scheme(DUMMY_DOMAIN, 443), "https", "Incorrect scheme detected")26self.assertEqual(detect_scheme(DUMMY_DOMAIN, 80), "http", "Incorrect scheme detected")27self.assertEqual(detect_scheme(DUMMY_DOMAIN, 1234), "http", "Incorrect scheme detected")282930