-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Add scale param to images #266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
if a user specifies ‘test.png’ as their filename, then don’t fuck with that! now, we were changing that to `’test.png.png’` if they also specified `format=‘png’`. sure, now they could set their filename `test.png` and their format `jpeg`, but that is their fault. this fixes the test, too.
arg_string = ', '.join([str(a) for a in args]) | ||
test_name = test_generator.__name__.replace('_generate', 'test') | ||
test_name += '({})'.format(arg_string) | ||
setattr(TestImage, test_name, _test) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is so much fun.
autogenerating tests of all of the permutations of input arguments!
♡ nosetests plotly/tests/test_core/test_image/ --pdb -v
_test_image_get_returns_valid_image_test(jpeg, 300, 300, None) (plotly.tests.test_core.test_image.test_image.TestImage) ... ok
_test_image_get_returns_valid_image_test(jpeg, 300, None, None) (plotly.tests.test_core.test_image.test_image.TestImage) ... ok
_test_image_get_returns_valid_image_test(jpeg, None, 300, None) (plotly.tests.test_core.test_image.test_image.TestImage) ... ok
_test_image_get_returns_valid_image_test(jpeg, None, None, None) (plotly.tests.test_core.test_image.test_image.TestImage) ... ok
_test_image_get_returns_valid_image_test(pdf, 300, 300, None) (plotly.tests.test_core.test_image.test_image.TestImage) ... ok
_test_image_get_returns_valid_image_test(pdf, 300, None, None) (plotly.tests.test_core.test_image.test_image.TestImage) ... ok
_test_image_get_returns_valid_image_test(pdf, None, 300, None) (plotly.tests.test_core.test_image.test_image.TestImage) ... ok
_test_image_get_returns_valid_image_test(pdf, None, None, None) (plotly.tests.test_core.test_image.test_image.TestImage) ... ok
_test_image_get_returns_valid_image_test(png, 300, 300, 5) (plotly.tests.test_core.test_image.test_image.TestImage) ... ok
_test_image_get_returns_valid_image_test(png, 300, 300, None) (plotly.tests.test_core.test_image.test_image.TestImage) ... ok
_test_image_get_returns_valid_image_test(png, 300, None, 5) (plotly.tests.test_core.test_image.test_image.TestImage) ... ok
_test_image_get_returns_valid_image_test(png, 300, None, None) (plotly.tests.test_core.test_image.test_image.TestImage) ... ok
_test_image_get_returns_valid_image_test(png, None, 300, 5) (plotly.tests.test_core.test_image.test_image.TestImage) ... ok
_test_image_get_returns_valid_image_test(png, None, 300, None) (plotly.tests.test_core.test_image.test_image.TestImage) ... ok
_test_image_get_returns_valid_image_test(png, None, None, 5) (plotly.tests.test_core.test_image.test_image.TestImage) ... ok
_test_image_get_returns_valid_image_test(png, None, None, None) (plotly.tests.test_core.test_image.test_image.TestImage) ... ok
_test_image_get_returns_valid_image_test(svg, 300, 300, None) (plotly.tests.test_core.test_image.test_image.TestImage) ... ok
_test_image_get_returns_valid_image_test(svg, 300, None, None) (plotly.tests.test_core.test_image.test_image.TestImage) ... ok
_test_image_get_returns_valid_image_test(svg, None, 300, None) (plotly.tests.test_core.test_image.test_image.TestImage) ... ok
_test_image_get_returns_valid_image_test(svg, None, None, None) (plotly.tests.test_core.test_image.test_image.TestImage) ... ok
heck yeah setattr
. this line assigns test functions to the test class which unique names that start with test_
and therefore are run by nose
!
@BRONSOLO @theengineear - these endpoints return a 400 now? ``` test_duplicate_folders (plotly.tests.test_core.test_file.test_file.FolderAPITestCase) ... ERROR ====================================================================== ERROR: test_duplicate_folders (plotly.tests.test_core.test_file.test_file.FolderAPITestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/ubuntu/python-api/plotly/tests/test_core/test_file/test_file.py", line 45, in test_duplicate_folders py.file_ops.mkdirs(first_folder) File "/home/ubuntu/python-api/plotly/plotly/plotly.py", line 717, in mkdirs _api_v2.response_handler(res) File "/home/ubuntu/python-api/plotly/plotly/plotly.py", line 1171, in response_handler raise(plotly_exception) PlotlyRequestError: -------------------- >> begin captured logging << -------------------- requests.packages.urllib3.connectionpool: INFO: Starting new HTTPS connection (1): api.plot.ly requests.packages.urllib3.connectionpool: DEBUG: "POST /v2/folders HTTP/1.1" 400 69 --------------------- >> end captured logging << --------------------- ```
@chriddyp , yup, it'd be best to test that it's 4xx for now. |
this is sweet btw! 💃 |
👍 |
@theengineear @BRONSOLO - it's not supposed to be a 4xx though, it's supposed to be a 200! |
@chriddyp sorry read that too fast, looking into it now (#266 (comment)) |
check it @cldougl @aneda @theengineear @BRONSOLO