Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions drive/snippets/drive-v3/file_snippet/test_create_folder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""Copyright 2022 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import unittest

import create_folder


class TestCreateFolder(unittest.TestCase):
"""Unit test class for file snippet"""

@classmethod
def test_create_folder(cls):
"""Test create_folder"""
file_id = create_folder.create_folder()
cls.assertIsNotNone(cls, file_id)


if __name__ == '__main__':
unittest.main()
31 changes: 31 additions & 0 deletions drive/snippets/drive-v3/file_snippet/test_create_shortcut.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""Copyright 2022 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import unittest

import create_shortcut


class TestCreateShortcut(unittest.TestCase):
"""Unit test class for file snippet"""

@classmethod
def test_create_shortcut(cls):
"""Test create_folder"""
file_id = create_shortcut.create_shortcut()
cls.assertIsNotNone(cls, file_id)


if __name__ == '__main__':
unittest.main()
33 changes: 33 additions & 0 deletions drive/snippets/drive-v3/file_snippet/test_download_file.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""Copyright 2022 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import unittest

import download_file


class TestDownloadFile(unittest.TestCase):
"""Unit test class for file snippet"""

@classmethod
def test_download_file(cls):
"""Test Download_file"""
# valid file id
real_file_id = '1KuPmvGq8yoYgbfW74OENMCB5H0n_2Jm9'
file = download_file.download_file(real_file_id=real_file_id)
cls.assertNotEqual(cls, 0, len(file))


if __name__ == '__main__':
unittest.main()
33 changes: 33 additions & 0 deletions drive/snippets/drive-v3/file_snippet/test_export_pdf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""Copyright 2022 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import unittest

import export_pdf


class TestExportPdf(unittest.TestCase):
"""Unit test class for file snippet"""

@classmethod
def test_export_pdf(cls):
"""Test export_pdf"""
# valid file ID
real_file_id = '1zbp8wAyuImX91Jt9mI-CAX_1TqkBLDEDcr2WeXBbKUY'
file = export_pdf.export_pdf(real_file_id=real_file_id)
cls.assertNotEqual(cls, 0, len(file))


if __name__ == '__main__':
unittest.main()
35 changes: 35 additions & 0 deletions drive/snippets/drive-v3/file_snippet/test_move_file_to_folder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""Copyright 2022 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import unittest

import move_file_to_folder


class TestMoveFileToFolder(unittest.TestCase):
"""Unit test class for file snippet"""

@classmethod
def test_move_file_to_folder(cls):
"""Test move_file_to_folder"""
real_file_id = '1KuPmvGq8yoYgbfW74OENMCB5H0n_2Jm9'
real_folder_id = '1v5eyIbXCr9TZX3eX_44HEExfe7yRj24V'

update = move_file_to_folder.move_file_to_folder(
real_file_id=real_file_id, real_folder_id=real_folder_id)
cls.assertIsNotNone(cls, 0, len(update))


if __name__ == '__main__':
unittest.main()
31 changes: 31 additions & 0 deletions drive/snippets/drive-v3/file_snippet/test_search_file.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""Copyright 2022 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import unittest

import search_file


class TestSearchFile(unittest.TestCase):
"""Unit test class for file snippet"""

@classmethod
def test_search_file(cls):
"""Test search_file"""
file = search_file.search_file()
cls.assertNotEqual(cls, 0, len(file))


if __name__ == '__main__':
unittest.main()