MCPcopy
hub / github.com/docker/docker-py / tar_test_negative_mtime_bug

Method tar_test_negative_mtime_bug

tests/unit/utils_build_test.py:465–475  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

463 assert sorted(tar_data.getnames()) == ['bar', 'foo']
464
465 def tar_test_negative_mtime_bug(self):
466 base = tempfile.mkdtemp()
467 filename = os.path.join(base, 'th.txt')
468 self.addCleanup(shutil.rmtree, base)
469 with open(filename, 'w') as f:
470 f.write('Invisible Full Moon')
471 os.utime(filename, (12345, -3600.0))
472 with tar(base) as archive:
473 tar_data = tarfile.open(fileobj=archive)
474 assert tar_data.getnames() == ['th.txt']
475 assert tar_data.getmember('th.txt').mtime == -3600
476
477 @pytest.mark.skipif(IS_WINDOWS_PLATFORM, reason='No symlinks on Windows')
478 def test_tar_directory_link(self):

Callers

nothing calls this directly

Calls 2

tarFunction · 0.90
joinMethod · 0.80

Tested by

no test coverage detected