MCPcopy Index your code
hub / github.com/python/cpython / _calc_size

Method _calc_size

Lib/test/test_tarfile.py:1919–1931  ·  view source on GitHub ↗
(self, name, link=None)

Source from the content-addressed store, hash-verified

1917 return blocks * 512
1918
1919 def _calc_size(self, name, link=None):
1920 # Initial tar header
1921 count = 512
1922
1923 if len(name) > tarfile.LENGTH_NAME:
1924 # GNU longname extended header + longname
1925 count += 512
1926 count += self._length(name)
1927 if link is not None and len(link) > tarfile.LENGTH_LINK:
1928 # GNU longlink extended header + longlink
1929 count += 512
1930 count += self._length(link)
1931 return count
1932
1933 def _test(self, name, link=None):
1934 tarinfo = tarfile.TarInfo(name)

Callers 1

_testMethod · 0.95

Calls 1

_lengthMethod · 0.95

Tested by

no test coverage detected