summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_platform.py
diff options
context:
space:
mode:
authorPetr Viktorin <encukou@gmail.com>2018-05-16 15:51:18 (GMT)
committerGitHub <noreply@github.com>2018-05-16 15:51:18 (GMT)
commit8b94b41ab7b12f745dea744e8940631318816935 (patch)
tree7712623c850aa5988a7024effe3ae3ce6777eaa8 /Lib/test/test_platform.py
parent93f9a8a5afb58b1d2e4f27bb46d3d4e0fa8c08f0 (diff)
downloadcpython-8b94b41ab7b12f745dea744e8940631318816935.zip
cpython-8b94b41ab7b12f745dea744e8940631318816935.tar.gz
cpython-8b94b41ab7b12f745dea744e8940631318816935.tar.bz2
bpo-28167: Remove platform.linux_distribution (GH-6871)
* test_ssl: Remove skip_if_broken_ubuntu_ssl We no longer support OpenSSL 0.9.8.15.15. * bpo-28167: Remove platform.linux_distribution
Diffstat (limited to 'Lib/test/test_platform.py')
-rw-r--r--Lib/test/test_platform.py65
1 files changed, 0 insertions, 65 deletions
diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py
index 5f1e28a..7e3e401 100644
--- a/Lib/test/test_platform.py
+++ b/Lib/test/test_platform.py
@@ -259,16 +259,6 @@ class PlatformTest(unittest.TestCase):
self.assertEqual(cpid, pid)
self.assertEqual(sts, 0)
- def test_dist(self):
- with warnings.catch_warnings():
- warnings.filterwarnings(
- 'ignore',
- r'dist\(\) and linux_distribution\(\) '
- 'functions are deprecated .*',
- PendingDeprecationWarning,
- )
- res = platform.dist()
-
def test_libc_ver(self):
import os
if os.path.isdir(sys.executable) and \
@@ -279,23 +269,6 @@ class PlatformTest(unittest.TestCase):
executable = sys.executable
res = platform.libc_ver(executable)
- def test_parse_release_file(self):
-
- for input, output in (
- # Examples of release file contents:
- ('SuSE Linux 9.3 (x86-64)', ('SuSE Linux ', '9.3', 'x86-64')),
- ('SUSE LINUX 10.1 (X86-64)', ('SUSE LINUX ', '10.1', 'X86-64')),
- ('SUSE LINUX 10.1 (i586)', ('SUSE LINUX ', '10.1', 'i586')),
- ('Fedora Core release 5 (Bordeaux)', ('Fedora Core', '5', 'Bordeaux')),
- ('Red Hat Linux release 8.0 (Psyche)', ('Red Hat Linux', '8.0', 'Psyche')),
- ('Red Hat Linux release 9 (Shrike)', ('Red Hat Linux', '9', 'Shrike')),
- ('Red Hat Enterprise Linux release 4 (Nahant)', ('Red Hat Enterprise Linux', '4', 'Nahant')),
- ('CentOS release 4', ('CentOS', '4', None)),
- ('Rocks release 4.2.1 (Cydonia)', ('Rocks', '4.2.1', 'Cydonia')),
- ('', ('', '', '')), # If there's nothing there.
- ):
- self.assertEqual(platform._parse_release_file(input), output)
-
def test_popen(self):
mswindows = (sys.platform == "win32")
@@ -328,43 +301,5 @@ class PlatformTest(unittest.TestCase):
returncode = ret >> 8
self.assertEqual(returncode, len(data))
- def test_linux_distribution_encoding(self):
- # Issue #17429
- with tempfile.TemporaryDirectory() as tempdir:
- filename = os.path.join(tempdir, 'fedora-release')
- with open(filename, 'w', encoding='utf-8') as f:
- f.write('Fedora release 19 (Schr\xf6dinger\u2019s Cat)\n')
-
- with mock.patch('platform._UNIXCONFDIR', tempdir):
- with warnings.catch_warnings():
- warnings.filterwarnings(
- 'ignore',
- r'dist\(\) and linux_distribution\(\) '
- 'functions are deprecated .*',
- PendingDeprecationWarning,
- )
- distname, version, distid = platform.linux_distribution()
-
- self.assertEqual(distname, 'Fedora')
- self.assertEqual(version, '19')
- self.assertEqual(distid, 'Schr\xf6dinger\u2019s Cat')
-
-
-class DeprecationTest(unittest.TestCase):
-
- def test_dist_deprecation(self):
- with self.assertWarns(DeprecationWarning) as cm:
- platform.dist()
- self.assertEqual(str(cm.warning),
- 'dist() and linux_distribution() functions are '
- 'deprecated in Python 3.5')
-
- def test_linux_distribution_deprecation(self):
- with self.assertWarns(DeprecationWarning) as cm:
- platform.linux_distribution()
- self.assertEqual(str(cm.warning),
- 'dist() and linux_distribution() functions are '
- 'deprecated in Python 3.5')
-
if __name__ == '__main__':
unittest.main()