test: turn test-doc into test-comment
We use comments in all other tests, rather than doc-strings. Convert the os-release test to do the same. If we wanted doc-strings, we can convert all tests over. This commit just tries to keep the tests in-sync. Note that doc-strings cause `unittest` to print the doc-strings to stdout during test-execution, making it overly verbose (especially for multiline docs). By converting it to comments, this behavior is suppressed.
This commit is contained in:
parent
fdff00d039
commit
451ec33d9e
1 changed files with 9 additions and 4 deletions
|
|
@ -12,14 +12,19 @@ from .. import test
|
|||
|
||||
class TestUtilOSRelease(test.TestBase, unittest.TestCase):
|
||||
def test_non_existant(self):
|
||||
"""Verify default os-release value, if no files are given."""
|
||||
#
|
||||
# Verify default os-release value, if no files are given.
|
||||
#
|
||||
|
||||
self.assertEqual(osrelease.describe_os(), "linux")
|
||||
|
||||
@unittest.skipUnless(test.TestBase.have_test_data(), "no test-data access")
|
||||
def test_describe_os(self):
|
||||
"""Test host os detection. test/os-release contains the os-release files
|
||||
for all supported runners.
|
||||
"""
|
||||
#
|
||||
# Test host os detection. test/os-release contains the os-release files
|
||||
# for all supported runners.
|
||||
#
|
||||
|
||||
for entry in os.scandir(os.path.join(self.locate_test_data(), "os-release")):
|
||||
with self.subTest(entry.name):
|
||||
self.assertEqual(osrelease.describe_os(entry.path), entry.name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue