MCPcopy Index your code
hub / github.com/RustPython/RustPython / _calc_size

Method _calc_size

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

Source from the content-addressed store, hash-verified

1900 return blocks * 512
1901
1902 def _calc_size(self, name, link=None):
1903 # Initial tar header
1904 count = 512
1905
1906 if len(name) > tarfile.LENGTH_NAME:
1907 # GNU longname extended header + longname
1908 count += 512
1909 count += self._length(name)
1910 if link is not None and len(link) > tarfile.LENGTH_LINK:
1911 # GNU longlink extended header + longlink
1912 count += 512
1913 count += self._length(link)
1914 return count
1915
1916 def _test(self, name, link=None):
1917 tarinfo = tarfile.TarInfo(name)

Callers 1

_testMethod · 0.95

Calls 2

_lengthMethod · 0.95
lenFunction · 0.85

Tested by

no test coverage detected