Browse files

URL Composer fixes

  • Loading branch information...
1 parent 6ab7c3c commit 6dd10b31c0f17ea10fccb9d25e292e6cb618073e @heynemann heynemann committed Oct 24, 2012
Showing with 26 additions and 4 deletions.
  1. +2 −0 thumbor/url_composer.py
  2. +1 −0 vows/crypto_vows.py
  3. +23 −4 vows/url_composer_vows.py
View
2 thumbor/url_composer.py
@@ -85,6 +85,7 @@ def main(arguments=None):
parsed_options.vertical_flip,
parsed_options.halign,
parsed_options.valign,
+ parsed_options.trim,
crop_left,
crop_top,
crop_right,
@@ -125,6 +126,7 @@ def main(arguments=None):
print 'Signed URL:'
print url
+ return url
if __name__ == '__main__':
main(sys.argv[1:])
View
1 vows/crypto_vows.py
@@ -159,6 +159,7 @@ def should_equal_encrypted_string(self, (topic, expected)):
'flip_vertical': False,
'halign': 'center',
'valign': 'middle',
+ 'trim': '',
'crop_left': 0,
'crop_top': 0,
'crop_right': 0,
View
27 vows/url_composer_vows.py
@@ -22,9 +22,28 @@ def topic(self):
def should_be_null(self, topic):
expect(topic).to_be_null()
+ class WhenProperArguments(Vows.Context):
+ def topic(self):
+ return main([
+ "-k", "MY-SECURITY-KEY",
+ "-w", "200",
+ "-e", "300",
+ "myserver.com/myimg.jpg"
+ ])
+
+ def should_be_proper_url(self, topic):
+ expect(topic).to_equal('/G_dykuWBGyEil5JnNh9cBke0Ajo=/200x300/myserver.com/myimg.jpg')
+
+ class WhenOldFormat(Vows.Context):
+ def topic(self):
+ return main([
+ "-k", "MY-SECURITY-KEY",
+ "-w", "200",
+ "-e", "300",
+ "--old-format",
+ "myserver.com/myimg.jpg"
+ ])
- #class WhenImagePassed(Vows.Context):
- #def topic(self):
- #return main([
+ def should_be_proper_url(self, topic):
+ expect(topic).to_equal('/6LSog0KmY0NQg8GK4Tsti0FAR9emvaF4xfyLY3FUmOI0HVcqF8HxibsAjVCbxFfl/myserver.com/myimg.jpg')
- #])

0 comments on commit 6dd10b3

Please sign in to comment.