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
81 changes: 0 additions & 81 deletions gmail/snippet/send mail/send_message_with_attachment.py

This file was deleted.

32 changes: 32 additions & 0 deletions gmail/snippet/send mail/test_create_draft.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""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

from create_draft import gmail_create_draft


class TestCreateDraft(unittest.TestCase):
"""Unit test classs for snippet"""

@classmethod
def test_create_draft(cls):
"""Unit test for create draft"""
draft = gmail_create_draft()
cls.assertIsNotNone(cls, draft)


if __name__ == '__main__':
unittest.main()
32 changes: 32 additions & 0 deletions gmail/snippet/send mail/test_create_draft_with_attachment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""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

from create_draft_with_attachment import gmail_create_draft_with_attachment


class TestCreateDraftWithAttachment(unittest.TestCase):
"""Unit test classs for Change snippet"""

@classmethod
def test_create_draft_with_attachment(cls):
"""Test create draft with attachment"""
draft = gmail_create_draft_with_attachment()
cls.assertIsNotNone(cls, draft)


if __name__ == '__main__':
unittest.main()
30 changes: 30 additions & 0 deletions gmail/snippet/send mail/test_send_message.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""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

from send_message import gmail_send_message


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

def test_send_message(self):
"""test send message"""
send_message = gmail_send_message()
self.assertIsNotNone(self, send_message)


if __name__ == '__main__':
unittest.main()
30 changes: 30 additions & 0 deletions gmail/snippet/send mail/test_send_message_with_attachment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""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

from send_message_with_attachment import gmail_send_message_with_attachment


class TestSendMessageWithAttachment(unittest.TestCase):
"""Unit test class for gmail snippet"""

def test_send_message_with_attachment(self):
""" test send message with attachment"""
send_message = gmail_send_message_with_attachment()
self.assertIsNotNone(self, send_message)


if __name__ == '__main__':
unittest.main()
31 changes: 31 additions & 0 deletions gmail/snippet/settings snippets/test_create_filter.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

from create_filter import create_filter


class TestCreateFilter(unittest.TestCase):
"""Unit test class to implement test case for Snippets"""

@classmethod
def test_create_file(cls):
"""test to create file"""
result = create_filter()
cls.assertIsNotNone(cls, result)


if __name__ == '__main__':
unittest.main()
31 changes: 31 additions & 0 deletions gmail/snippet/settings snippets/test_enable_auto_reply.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

from enable_auto_reply import enable_auto_reply


class TestEnableAutoReply(unittest.TestCase):
"""Unit test class for the snippet"""

@classmethod
def test_enable_auto_reply(cls):
""" test to enable auto reply"""
result = enable_auto_reply()
cls.assertIsNotNone(cls, result)


if __name__ == '__main__':
unittest.main()
31 changes: 31 additions & 0 deletions gmail/snippet/settings snippets/test_enable_forwarding.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

from enable_forwarding import enable_forwarding


class TestEnableForwarding(unittest.TestCase):
"""Unit test class to test enable forwarding snippet"""

@classmethod
def test_enable_forwarding(cls):
"""test to enable forwarding"""
result = enable_forwarding()
cls.assertIsNotNone(cls, result)


if __name__ == '__main__':
unittest.main()
31 changes: 31 additions & 0 deletions gmail/snippet/settings snippets/test_update_signature.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

from update_signature import update_signature


class TestUpdateSignature(unittest.TestCase):
"""Unit test class to test Update signature snippet"""

@classmethod
def test_update_signature(cls):
""" test to update signature"""
result = update_signature()
cls.assertIsNotNone(cls, result)


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions gmail/snippet/smime snippets/insert_cert_from_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def insert_cert_from_csv(csv_filename):
insert_smime_info.insert_smime_info()
else:
print(F'Unable to read certificate file for user_id: {user_id}')
return smime_info

except (OSError, IOError) as error:
print(F'An error occured while reading the CSV file: {error}')
Expand Down
32 changes: 32 additions & 0 deletions gmail/snippet/smime snippets/test_create_smime_info.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""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

from create_smime_info import create_smime_info


class TestCreateSmimeInfo(unittest.TestCase):
"""Unit test class to test Snippet"""

@classmethod
def test_create_smime_info(cls):
"""test to create smime info"""
# enter the file and password accordingly
smime_info = create_smime_info(cert_filename='abc', cert_password='abc')
cls.assertIsNotNone(cls, smime_info)


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