Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Add user_setup helper function and use in invalid_data_image test
Browse files Browse the repository at this point in the history
Added user_setup helper function and used it in the invalid_data_image
test.
  • Loading branch information
leni1 committed May 8, 2018
1 parent fd57def commit 44bb193
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions test/server/test_image_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,21 @@
random.seed(0)

def image_setup():
for image in example_images:
valid_data_image = image['url']
return valid_data_image

def user_setup():
with screenshots_session() as user:
shot_id = make_random_id() + "/test.com"
shot_data = urljoin(user.backend, "data/" + shot_id)
shot_json = make_example_shot(user.deviceId)
for image in example_images:
valid_data_image = image['url']
return valid_data_image
return shot_data, shot_json


def test_invalid_data_image():
# with screenshots_session() as user:
# shot_id = make_random_id() + "/test.com"
# shot_data = urljoin(user.backend, "data/" + shot_id)
# shot_json = make_example_shot(user.deviceId)
# for image in example_images:
# valid_data_image = image['url']
shot_json = make_example_shot(user.deviceId)
image = image_setup()
(shot_data, shot_json) = user_setup()
if "iVBORw0KGgo" in image:
invalid_data_image = image.replace('iVBORw0KGgo', 'R0k')
for clip_id in shot_json['clips']:
Expand Down

0 comments on commit 44bb193

Please sign in to comment.