Skip to content

Commit 90cca8a

Browse files
committed
Raises an exception if the wrong app resource file type is specified.
1 parent 2a54381 commit 90cca8a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ def upload_file(file_path):
2020

2121
if basename.endswith('.jar'):
2222
content_type = 'application/java-archive'
23-
else:
23+
elif basename.endswith('.py'):
2424
content_type = 'application/x-python'
25+
else:
26+
raise ValueError("Unexpected file type: {}. Expected .jar or .py file.".format(basename))
2527

2628
key = Key(bucket, '{}/{}'.format(os.environ['S3_PREFIX'], basename))
2729
key.metadata = {'Content-Type': content_type}

0 commit comments

Comments
 (0)