# # Software distributed under the License is distributed on an "AS IS" basis, # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for # the specific language governing rights and limitations under the License. # # The Original Code is reddit. # # The Original Developer is the Initial Developer. The Initial Developer of # the Original Code is reddit Inc. # # All portions of the code written by reddit are Copyright (c) 2006-2015 reddit # Inc. All Rights Reserved. ############################################################################### from r2.tests import stage_for_paste stage_for_paste() import unittest from r2.lib.providers.image_resizing.unsplashit import UnsplashitImageResizingProvider class TestLocalResizer(unittest.TestCase): @classmethod def setUpClass(cls): cls.provider = UnsplashitImageResizingProvider() def test_no_resize(self): image = dict(url='http://s3.amazonaws.com/a.jpg', width=200, height=800) url = self.provider.resize_image(image)
def setUpClass(cls): stage_for_paste() cls._old_offsite = g.offsite_subdomains g.offsite_subdomains = ["blog"]
# # Software distributed under the License is distributed on an "AS IS" basis, # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for # the specific language governing rights and limitations under the License. # # The Original Code is reddit. # # The Original Developer is the Initial Developer. The Initial Developer of # the Original Code is reddit Inc. # # All portions of the code written by reddit are Copyright (c) 2006-2015 reddit # Inc. All Rights Reserved. ############################################################################### from r2.tests import stage_for_paste stage_for_paste() import unittest from pylons import g from r2.lib.providers.image_resizing import NotLargeEnough from r2.lib.providers.image_resizing.imgix import ImgixImageResizingProvider from r2.lib.utils import UrlParser URLENCODED_COMMA = '%2C' class TestImgixResizer(unittest.TestCase): @classmethod def setUpClass(cls):