Skip to content
Open
3 changes: 2 additions & 1 deletion tests/providers/googledrive/test_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def test_file_metadata_docs(self, basepath, root_provider_fixtures):
'webView': item['alternateLink'],
}
assert parsed.is_google_doc is True
assert parsed.export_name == item['title'] + '.docx'
assert parsed.export_name == item['title'] + '.gdoc.docx'

def test_folder_metadata(self, root_provider_fixtures):
item = root_provider_fixtures['folder_metadata']
Expand Down Expand Up @@ -113,3 +113,4 @@ def test_revision_metadata(self, revision_fixtures):
assert parsed.version_identifier == 'revision'
assert parsed.version == item['id']
assert parsed.modified == item['modifiedDate']

13 changes: 6 additions & 7 deletions tests/providers/googledrive/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ async def test_download_editable_gdoc_no_revision(self, provider, sharing_fixtur
aiohttpretty.register_uri('GET', download_file_url, body=file_content, auto_length=True)

result = await provider.download(path)
assert result.name == 'editable_gdoc.docx'
assert result.name == 'editable_gdoc.gdoc.docx'

content = await result.read()
assert content == file_content
Expand All @@ -638,7 +638,7 @@ async def test_download_editable_gdoc_good_revision(self, provider, sharing_fixt
aiohttpretty.register_uri('GET', download_file_url, body=file_content, auto_length=True)

result = await provider.download(path, revision=self.GDOC_GOOD_REVISION)
assert result.name == 'editable_gdoc.docx'
assert result.name == 'editable_gdoc.gdoc.docx'

content = await result.read()
assert content == file_content
Expand Down Expand Up @@ -686,7 +686,7 @@ async def test_download_editable_gdoc_magic_revision(self, provider, sharing_fix
aiohttpretty.register_uri('GET', download_file_url, body=file_content, auto_length=True)

result = await provider.download(path, revision=self.MAGIC_REVISION)
assert result.name == 'editable_gdoc.docx'
assert result.name == 'editable_gdoc.gdoc.docx'

content = await result.read()
assert content == file_content
Expand All @@ -712,7 +712,7 @@ async def test_download_viewable_gdoc_no_revision(self, provider, sharing_fixtur
aiohttpretty.register_uri('GET', download_file_url, body=file_content, auto_length=True)

result = await provider.download(path)
assert result.name == 'viewable_gdoc.docx'
assert result.name == 'viewable_gdoc.gdoc.docx'

content = await result.read()
assert content == file_content
Expand Down Expand Up @@ -756,7 +756,7 @@ async def test_download_viewable_gdoc_magic_revision(self, provider, sharing_fix
aiohttpretty.register_uri('GET', download_file_url, body=file_content, auto_length=True)

result = await provider.download(path, revision=self.MAGIC_REVISION)
assert result.name == 'viewable_gdoc.docx'
assert result.name == 'viewable_gdoc.gdoc.docx'

content = await result.read()
assert content == file_content
Expand Down Expand Up @@ -1617,8 +1617,7 @@ def test_path_from_metadata(self, provider, root_provider_fixtures):
metadata = GoogleDriveFileMetadata(item, src_path)
child_path = provider.path_from_metadata(src_path.parent, metadata)

assert child_path.full_path == src_path.full_path
assert child_path == src_path
assert child_path.full_path == 'version-test.gdoc.docx'

@pytest.mark.asyncio
@pytest.mark.aiohttpretty
Expand Down
2 changes: 1 addition & 1 deletion waterbutler/providers/googledrive/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def is_google_doc(self):

@property
def export_name(self):
title = self._file_title
title = self.name
if self.is_google_doc:
ext = utils.get_download_extension(self.raw)
title += ext
Expand Down