コード例 #1
0
ファイル: tgz_md5_test.py プロジェクト: mathieu/conan
    def test_md5_compress(self):
        folder = temp_folder()
        save(os.path.join(folder, "one_file.txt"), b"The contents")
        save(os.path.join(folder, "Two_file.txt"), b"Two contents")

        files = {
            "one_file.txt": os.path.join(folder, "one_file.txt"),
            "Two_file.txt": os.path.join(folder, "Two_file.txt"),
        }

        compress_files(files, {}, PACKAGE_TGZ_NAME, dest_dir=folder)
        file_path = os.path.join(folder, PACKAGE_TGZ_NAME)

        md5_a = md5sum(file_path)
        self.assertEqual(md5_a, "df220cfbc0652e8992a89a77666c03b5")

        time.sleep(1)  # Timestamps change

        folder = temp_folder()
        compress_files(files, {}, PACKAGE_TGZ_NAME, dest_dir=folder)
        file_path = os.path.join(folder, PACKAGE_TGZ_NAME)

        md5_b = md5sum(file_path)

        self.assertEquals(md5_a, md5_b)
コード例 #2
0
    def testMd5Name(self):
        files = {
            "one_file.txt": {
                "contents": b"The contents",
                "mode": 0o777
            },
            "Two_file.txt": {
                "contents": b"Two contents",
                "mode": 0o777
            }
        }
        new_files = compress_files(files, PACKAGE_TGZ_NAME, excluded=[])
        folder = temp_folder()
        file_path = os.path.join(folder, PACKAGE_TGZ_NAME)
        save(file_path, new_files[PACKAGE_TGZ_NAME])

        md5_a = md5sum(file_path)

        time.sleep(1)  # Timestamps change

        new_files = compress_files(files, PACKAGE_TGZ_NAME, excluded=[])
        folder = temp_folder()
        file_path = os.path.join(folder, PACKAGE_TGZ_NAME)
        save(file_path, new_files[PACKAGE_TGZ_NAME])

        md5_b = md5sum(file_path)

        self.assertEquals(md5_a, md5_b)
コード例 #3
0
ファイル: tgz_md5_test.py プロジェクト: 19317362/conan
    def test_md5_compress(self):
        folder = temp_folder()
        save(os.path.join(folder, "one_file.txt"), b"The contents")
        save(os.path.join(folder, "Two_file.txt"), b"Two contents")

        files = {
            "one_file.txt": os.path.join(folder, "one_file.txt"),
            "Two_file.txt": os.path.join(folder, "Two_file.txt"),
        }

        compress_files(files, {}, PACKAGE_TGZ_NAME, dest_dir=folder)
        file_path = os.path.join(folder, PACKAGE_TGZ_NAME)

        md5_a = md5sum(file_path)
        self.assertEqual(md5_a, "df220cfbc0652e8992a89a77666c03b5")

        time.sleep(1)  # Timestamps change

        folder = temp_folder()
        compress_files(files, {}, PACKAGE_TGZ_NAME, dest_dir=folder)
        file_path = os.path.join(folder, PACKAGE_TGZ_NAME)

        md5_b = md5sum(file_path)

        self.assertEquals(md5_a, md5_b)
コード例 #4
0
    def testMd5Name(self):
        folder = temp_folder()
        save(os.path.join(folder, "one_file.txt"), b"The contents")
        save(os.path.join(folder, "Two_file.txt"), b"Two contents")

        files = {
            "one_file.txt": os.path.join(folder, "one_file.txt"),
            "Two_file.txt": os.path.join(folder, "Two_file.txt"),
        }

        compress_files(files,
                       PACKAGE_TGZ_NAME,
                       excluded=[PACKAGE_TGZ_NAME],
                       dest_dir=folder)
        file_path = os.path.join(folder, PACKAGE_TGZ_NAME)

        md5_a = md5sum(file_path)

        time.sleep(1)  # Timestamps change

        folder = temp_folder()
        compress_files(files,
                       PACKAGE_TGZ_NAME,
                       excluded=[PACKAGE_TGZ_NAME],
                       dest_dir=folder)
        file_path = os.path.join(folder, PACKAGE_TGZ_NAME)

        md5_b = md5sum(file_path)

        self.assertEquals(md5_a, md5_b)
コード例 #5
0
ファイル: remote_manager_test.py プロジェクト: xaqq/conan
    def test_compress_files(self):
        folder = temp_folder()
        save(os.path.join(folder, "one_file.txt"), b"The contents")
        save(os.path.join(folder, "Two_file.txt"), b"Two contents")

        files = {
            "one_file.txt": os.path.join(folder, "one_file.txt"),
            "Two_file.txt": os.path.join(folder, "Two_file.txt"),
        }

        path = compress_files(files, {}, PACKAGE_TGZ_NAME, dest_dir=folder)
        self.assertTrue(os.path.exists(path))
        expected_path = os.path.join(folder, PACKAGE_TGZ_NAME)
        self.assertEqual(path, expected_path)
コード例 #6
0
ファイル: tgz_md5_test.py プロジェクト: lasote/conan
    def testMd5Name(self):
        folder = temp_folder()
        save(os.path.join(folder, "one_file.txt"), b"The contents")
        save(os.path.join(folder, "Two_file.txt"), b"Two contents")

        files = {
            "one_file.txt": os.path.join(folder, "one_file.txt"),
            "Two_file.txt": os.path.join(folder, "Two_file.txt"),
        }

        compress_files(files, PACKAGE_TGZ_NAME, excluded=[PACKAGE_TGZ_NAME], dest_dir=folder)
        file_path = os.path.join(folder, PACKAGE_TGZ_NAME)

        md5_a = md5sum(file_path)

        time.sleep(1)  # Timestamps change

        folder = temp_folder()
        compress_files(files, PACKAGE_TGZ_NAME, excluded=[PACKAGE_TGZ_NAME], dest_dir=folder)
        file_path = os.path.join(folder, PACKAGE_TGZ_NAME)

        md5_b = md5sum(file_path)

        self.assertEquals(md5_a, md5_b)