Skip to content

Commit b2048b1

Browse files
committed
chore: Remove excess test code
1 parent 1bd378c commit b2048b1

2 files changed

Lines changed: 2 additions & 19 deletions

File tree

slides/snippets/slides_text_merging.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@ def text_merging(template_presentation_id, data_spreadsheet_id):
3131
"""
3232
creds, _ = google.auth.default()
3333
# pylint: disable=maybe-no-member
34-
responses = []
3534

3635
try:
37-
3836
service = build('slides', 'v1', credentials=creds)
3937
sheets_service = build('sheets', 'v4', credentials=creds)
4038
drive_service = build('drive', 'v3', credentials=creds)
@@ -98,9 +96,7 @@ def text_merging(template_presentation_id, data_spreadsheet_id):
9896
}
9997
response = service.presentations().batchUpdate(
10098
presentationId=presentation_copy_id, body=body).execute()
101-
# [START_EXCLUDE silent]
102-
responses.append(response)
103-
# [END_EXCLUDE]
99+
104100
# Count the total number of replacements made.
105101
num_replacements = 0
106102
for reply in response.get('replies'):
@@ -111,8 +107,6 @@ def text_merging(template_presentation_id, data_spreadsheet_id):
111107
f"{customer_name} with ID: {presentation_copy_id}")
112108
print(f"Replaced {num_replacements} text instances")
113109

114-
return response
115-
116110
except HttpError as error:
117111
print(f"An error occurred: {error}")
118112
return error

slides/snippets/test_slides_text_merging.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,9 @@ class TestTextMerging(BaseTest):
2525

2626
def test_text_merging(self):
2727
""" text_merging method """
28-
29-
responses = slides_text_merging.text_merging(
28+
slides_text_merging.text_merging(
3029
self.TEMPLATE_PRESENTATION_ID,
3130
self.DATA_SPREADSHEET_ID)
32-
for response in responses:
33-
presentation_id = response.get('presentationId')
34-
self.delete_file_on_cleanup(presentation_id)
35-
self.assertIsNotNone(presentation_id, msg=pformat(response))
36-
self.assertEqual(3, len(response.get('replies')),
37-
msg=pformat(response))
38-
num_replacements = 0
39-
for reply in response.get('replies'):
40-
num_replacements += reply.get('replaceAllText') \
41-
.get('occurrencesChanged')
4231

4332

4433
if __name__ == "__main__":

0 commit comments

Comments
 (0)