From 78628332855648b073266b44701db9a152042387 Mon Sep 17 00:00:00 2001 From: himanshupr Date: Wed, 25 May 2022 13:32:32 +0000 Subject: [PATCH 1/4] UT for 3 region tags for app_data_snippet for drive-v3. --- .../test_fetch_appdata_folder.py | 31 ++++++++++++++++ .../app_data_snippet/test_list_appdata.py | 31 ++++++++++++++++ .../app_data_snippet/test_upload_appdata.py | 35 +++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 drive/snippets/drive-v3/app_data_snippet/test_fetch_appdata_folder.py create mode 100644 drive/snippets/drive-v3/app_data_snippet/test_list_appdata.py create mode 100644 drive/snippets/drive-v3/app_data_snippet/test_upload_appdata.py diff --git a/drive/snippets/drive-v3/app_data_snippet/test_fetch_appdata_folder.py b/drive/snippets/drive-v3/app_data_snippet/test_fetch_appdata_folder.py new file mode 100644 index 00000000..c48b3472 --- /dev/null +++ b/drive/snippets/drive-v3/app_data_snippet/test_fetch_appdata_folder.py @@ -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 fetch_appdata_folder + + +class TestFetchAppdataFolder(unittest.TestCase): + """Unit test class for Appdata snippet""" + + @classmethod + def test_list_appdata(cls): + """Test list_appdata""" + file_id = fetch_appdata_folder.fetch_appdata_folder() + cls.assertIsNotNone(cls, file_id) + + +if __name__ == '__main__': + unittest.main() diff --git a/drive/snippets/drive-v3/app_data_snippet/test_list_appdata.py b/drive/snippets/drive-v3/app_data_snippet/test_list_appdata.py new file mode 100644 index 00000000..dd66a706 --- /dev/null +++ b/drive/snippets/drive-v3/app_data_snippet/test_list_appdata.py @@ -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 list_appdata + + +class TestListAppdata(unittest.TestCase): + """Unit test class for Appdata snippet""" + + @classmethod + def test_list_appdata(cls): + """Test list_appdata""" + files = list_appdata.list_appdata() + cls.assertNotEqual(cls, 0, len(files)) + + +if __name__ == '__main__': + unittest.main() diff --git a/drive/snippets/drive-v3/app_data_snippet/test_upload_appdata.py b/drive/snippets/drive-v3/app_data_snippet/test_upload_appdata.py new file mode 100644 index 00000000..95b5025b --- /dev/null +++ b/drive/snippets/drive-v3/app_data_snippet/test_upload_appdata.py @@ -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 upload_app_data + + +class TestUploadAppdata(unittest.TestCase): + """ + Unit test class for Appdata snippet + """ + + @classmethod + def test_upload_adddata(cls): + """Test upload_appdata + create a text file titled "abc.txt" in order to pass this test + """ + file_id = upload_app_data.upload_appdata() + cls.assertIsNotNone(cls, file_id) + + +if __name__ == '__main__': + unittest.main() From 8b67fefc1d054caf8767f311bd2c14a249366886 Mon Sep 17 00:00:00 2001 From: himanshupr Date: Wed, 25 May 2022 13:37:09 +0000 Subject: [PATCH 2/4] UT for 3 region tags for change_snippet for drive-v3. --- .../change_snippet/test_fetch_changes.py | 34 +++++++++++++++++++ .../test_fetch_start_page_token.py | 31 +++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 drive/snippets/drive-v3/change_snippet/test_fetch_changes.py create mode 100644 drive/snippets/drive-v3/change_snippet/test_fetch_start_page_token.py diff --git a/drive/snippets/drive-v3/change_snippet/test_fetch_changes.py b/drive/snippets/drive-v3/change_snippet/test_fetch_changes.py new file mode 100644 index 00000000..a172f69e --- /dev/null +++ b/drive/snippets/drive-v3/change_snippet/test_fetch_changes.py @@ -0,0 +1,34 @@ +"""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 fetch_changes +import fetch_start_page_token + + +class TestFetchChanges(unittest.TestCase): + """Unit test classs for Change snippet""" + + @classmethod + def test_fetch_changes(cls): + """Test fetch_changes""" + start_token = fetch_start_page_token.fetch_start_page_token() + token = fetch_changes.fetch_changes(start_token) + cls.assertIsNotNone(cls, token) + + +if __name__ == '__main__': + unittest.main() diff --git a/drive/snippets/drive-v3/change_snippet/test_fetch_start_page_token.py b/drive/snippets/drive-v3/change_snippet/test_fetch_start_page_token.py new file mode 100644 index 00000000..9405cfa6 --- /dev/null +++ b/drive/snippets/drive-v3/change_snippet/test_fetch_start_page_token.py @@ -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 fetch_start_page_token + + +class TestFetchChanges(unittest.TestCase): + """Unit test classs for Change snippet""" + + @classmethod + def test_fetch_start_page_token(cls): + """Test fetch_start_page_token""" + token = fetch_start_page_token.fetch_start_page_token() + cls.assertIsNotNone(cls, token) + + +if __name__ == '__main__': + unittest.main() From a3fefb49f4ff7d13f9fb2481c8db56500cd3105a Mon Sep 17 00:00:00 2001 From: himanshupr2627 Date: Wed, 25 May 2022 13:52:16 +0000 Subject: [PATCH 3/4] Delete test_fetch_changes.py --- .../change_snippet/test_fetch_changes.py | 34 ------------------- 1 file changed, 34 deletions(-) delete mode 100644 drive/snippets/drive-v3/change_snippet/test_fetch_changes.py diff --git a/drive/snippets/drive-v3/change_snippet/test_fetch_changes.py b/drive/snippets/drive-v3/change_snippet/test_fetch_changes.py deleted file mode 100644 index a172f69e..00000000 --- a/drive/snippets/drive-v3/change_snippet/test_fetch_changes.py +++ /dev/null @@ -1,34 +0,0 @@ -"""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 fetch_changes -import fetch_start_page_token - - -class TestFetchChanges(unittest.TestCase): - """Unit test classs for Change snippet""" - - @classmethod - def test_fetch_changes(cls): - """Test fetch_changes""" - start_token = fetch_start_page_token.fetch_start_page_token() - token = fetch_changes.fetch_changes(start_token) - cls.assertIsNotNone(cls, token) - - -if __name__ == '__main__': - unittest.main() From fc17d01f4b67b7b9d992426089de2dd2fa96860c Mon Sep 17 00:00:00 2001 From: himanshupr2627 Date: Wed, 25 May 2022 13:57:16 +0000 Subject: [PATCH 4/4] Delete test_fetch_start_page_token.py --- .../test_fetch_start_page_token.py | 31 ------------------- 1 file changed, 31 deletions(-) delete mode 100644 drive/snippets/drive-v3/change_snippet/test_fetch_start_page_token.py diff --git a/drive/snippets/drive-v3/change_snippet/test_fetch_start_page_token.py b/drive/snippets/drive-v3/change_snippet/test_fetch_start_page_token.py deleted file mode 100644 index 9405cfa6..00000000 --- a/drive/snippets/drive-v3/change_snippet/test_fetch_start_page_token.py +++ /dev/null @@ -1,31 +0,0 @@ -"""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 fetch_start_page_token - - -class TestFetchChanges(unittest.TestCase): - """Unit test classs for Change snippet""" - - @classmethod - def test_fetch_start_page_token(cls): - """Test fetch_start_page_token""" - token = fetch_start_page_token.fetch_start_page_token() - cls.assertIsNotNone(cls, token) - - -if __name__ == '__main__': - unittest.main()