コード例 #1
0
    def test_children_trashed(self, remote_tmpdir: DriveFolder):
        remote_file = remote_tmpdir.new_file(random_string())
        remote_file.upload_empty()
        remote_file.trash()

        assert remote_file not in remote_tmpdir.children()
        assert remote_file in remote_tmpdir.children(trashed=True)
コード例 #2
0
    def test_children_onlyfiles(self, remote_tmpdir: DriveFolder):
        remote_folder = remote_tmpdir.mkdir(random_string())
        remote_file = remote_tmpdir.new_file(random_string())
        remote_file.upload_empty()

        filelist = list(remote_tmpdir.children(folders=False))
        assert remote_folder not in filelist
        assert remote_file in filelist
コード例 #3
0
    def test_children(self, remote_tmp_subdir: DriveFolder, remote_tmpfile):
        file_count = 5
        created_files = set()
        for _ in range(0, file_count):
            created_files.add(remote_tmpfile(subdir=remote_tmp_subdir))

        listed_files = set(remote_tmp_subdir.children())

        assert created_files == listed_files
コード例 #4
0
    def test_children_ordered(self, remote_tmp_subdir: DriveFolder,
                              remote_tmpfile):
        file_count = 5
        created_files = []
        for _ in range(0, file_count):
            created_files.append(remote_tmpfile(subdir=remote_tmp_subdir))
        created_files.sort(key=lambda x: x.name)

        listed_files = list(remote_tmp_subdir.children(orderBy="name"))

        assert created_files == listed_files