Coverage for tld/tests/test_commands.py: 74%
23 statements
« prev ^ index » next coverage.py v7.2.7, created at 2024-05-26 22:29 +0000
« prev ^ index » next coverage.py v7.2.7, created at 2024-05-26 22:29 +0000
1# -*- coding: utf-8 -*-
3import logging
4import subprocess
5import unittest
7from .base import internet_available_only, log_info
9__author__ = "Artur Barseghyan"
10__copyright__ = "2013-2023 Artur Barseghyan"
11__license__ = "GPL 2.0/LGPL 2.1"
12__all__ = ("TestCommands",)
14LOGGER = logging.getLogger(__name__)
17class TestCommands(unittest.TestCase):
18 """Tld commands tests."""
20 def setUp(self):
21 """Set up."""
23 @internet_available_only
24 @log_info
25 def test_1_update_tld_names_command(self):
26 """Test updating the tld names (re-fetch mozilla source)."""
27 res = subprocess.check_output(["update-tld-names"]).strip()
28 self.assertEqual(res, b"")
29 return res
31 @internet_available_only
32 @log_info
33 def test_1_update_tld_names_mozilla_command(self):
34 """Test updating the tld names (re-fetch mozilla source)."""
35 res = subprocess.check_output(["update-tld-names", "mozilla"]).strip()
36 self.assertEqual(res, b"")
37 return res