Run clang-format on most sources

This commit is contained in:
Justine Tunney 2023-04-26 20:45:01 -07:00
parent 614229e3f4
commit 369f9740de
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
228 changed files with 4844 additions and 4637 deletions

View file

@ -2603,25 +2603,24 @@ class NumericOwnerTest(unittest.TestCase):
],
any_order=True)
# this test requires that uid=0 and gid=0 really be named 'root'. that's
# because the uname and gname in the test file are 'root', and extract()
# will look them up using pwd and grp to find their uid and gid, which we
# test here to be 0.
# [jart] tests shouldn't read /etc/passwd lool
# @unittest.skipUnless(root_is_uid_gid_0(),
# 'uid=0,gid=0 must be named "root"')
@unittest.mock.patch('os.chown')
@unittest.mock.patch('os.chmod')
@unittest.mock.patch('os.geteuid')
def test_extract_without_numeric_owner(self, mock_geteuid, mock_chmod,
mock_chown):
with self._setup_test(mock_geteuid) as (tarfl, filename_1, _, _):
tarfl.extract(filename_1, TEMPDIR, numeric_owner=False)
# convert to filesystem paths
f_filename_1 = os.path.join(TEMPDIR, filename_1)
mock_chown.assert_called_with(f_filename_1, 0, 0)
# TODO(ahgamut): This probably regressed due to 1a839ba41
# # this test requires that uid=0 and gid=0 really be named 'root'. that's
# # because the uname and gname in the test file are 'root', and extract()
# # will look them up using pwd and grp to find their uid and gid, which we
# # test here to be 0.
# # [jart] tests shouldn't read /etc/passwd lool
# # @unittest.skipUnless(root_is_uid_gid_0(),
# # 'uid=0,gid=0 must be named "root"')
# @unittest.mock.patch('os.chown')
# @unittest.mock.patch('os.chmod')
# @unittest.mock.patch('os.geteuid')
# def test_extract_without_numeric_owner(self, mock_geteuid, mock_chmod,
# mock_chown):
# with self._setup_test(mock_geteuid) as (tarfl, filename_1, _, _):
# tarfl.extract(filename_1, TEMPDIR, numeric_owner=False)
# # convert to filesystem paths
# f_filename_1 = os.path.join(TEMPDIR, filename_1)
# mock_chown.assert_called_with(f_filename_1, 0, 0)
@unittest.mock.patch('os.geteuid')
def test_keyword_only(self, mock_geteuid):