コード例 #1
0
    async def test_metadata_folder_nested(self, provider):
        path = GoogleDrivePath('/hugo/kim/pins/',
                               _ids=[str(x) for x in range(4)])

        body = fixtures.generate_list(3)
        item = body['items'][0]

        query = provider._build_query(path.identifier)
        url = provider.build_url('files', q=query, alt='json', maxResults=1000)

        aiohttpretty.register_json_uri('GET', url, body=body)

        result = await provider.metadata(path)

        expected = GoogleDriveFileMetadata(item, path.child(item['title']))

        assert result == [expected]
        assert aiohttpretty.has_call(method='GET', uri=url)
コード例 #2
0
    def test_folder_metadata(self, provider):
        path = GoogleDrivePath('/hugo/kim/pins/',
                               _ids=[str(x) for x in range(4)])

        body = fixtures.generate_list(3, **fixtures.folder_metadata)
        item = body['items'][0]

        query = provider._build_query(path.identifier)
        url = provider.build_url('files', q=query, alt='json')

        aiohttpretty.register_json_uri('GET', url, body=body)

        result = yield from provider.metadata(path)

        expected = GoogleDriveFolderMetadata(
            item, path.child(item['title'], folder=True)).serialized()

        assert result == [expected]
        assert aiohttpretty.has_call(method='GET', uri=url)
コード例 #3
0
ファイル: test_provider.py プロジェクト: Ghalko/waterbutler
    def test_folder_metadata(self, provider):
        path = GoogleDrivePath(
            '/hugo/kim/pins/',
            _ids=[str(x) for x in range(4)]
        )

        body = fixtures.generate_list(3, **fixtures.folder_metadata)
        item = body['items'][0]

        query = provider._build_query(path.identifier)
        url = provider.build_url('files', q=query, alt='json')

        aiohttpretty.register_json_uri('GET', url, body=body)

        result = yield from provider.metadata(path)

        expected = GoogleDriveFolderMetadata(item, path.child(item['title'], folder=True)).serialized()

        assert result == [expected]
        assert aiohttpretty.has_call(method='GET', uri=url)
コード例 #4
0
    async def test_metadata_folder_nested(self, provider):
        path = GoogleDrivePath(
            '/hugo/kim/pins/',
            _ids=[str(x) for x in range(4)]
        )

        body = fixtures.generate_list(3)
        item = body['items'][0]

        query = provider._build_query(path.identifier)
        url = provider.build_url('files', q=query, alt='json', maxResults=1000)

        aiohttpretty.register_json_uri('GET', url, body=body)

        result = await provider.metadata(path)

        expected = GoogleDriveFileMetadata(item, path.child(item['title']))

        assert result == [expected]
        assert aiohttpretty.has_call(method='GET', uri=url)