<s> import os <EOL> from django import test <EOL> from . helpers import CropdusterTestCaseMediaMixin <EOL> from cropduster . resizing import Crop , Box , Size <EOL> class TestResizing ( CropdusterTestCaseMediaMixin , test . TestCase ) : <EOL> def test_off_by_one_bug ( self ) : <EOL> img_path = os . path . join ( self . TEST_IMG_DIR , '<STR_LIT>' ) <EOL> crop = Crop ( Box ( x1 = <NUM_LIT:0> , y1 = <NUM_LIT:0> , x2 = <NUM_LIT> , y2 = <NUM_LIT> ) , img_path ) <EOL> size = Size ( '<STR_LIT>' , w = <NUM_LIT> , h = <NUM_LIT> ) <EOL> new_crop = size . fit_to_crop ( crop ) <EOL> self . assertNotEqual ( new_crop . box . h , <NUM_LIT> , "<STR_LIT>" ) <EOL> self . assertEqual ( new_crop . box . h , <NUM_LIT> ) <EOL> def test_size_order_bug ( self ) : <EOL> img_path = os . path . join ( self . TEST_IMG_DIR , '<STR_LIT>' ) <EOL> crop = Crop ( Box ( x1 = <NUM_LIT> , y1 = <NUM_LIT:0> , x2 = <NUM_LIT> , y2 = <NUM_LIT> ) , img_path ) <EOL> size = Size ( '<STR_LIT>' , w = <NUM_LIT> , min_h = <NUM_LIT> ) <EOL> new_crop = size . fit_to_crop ( crop ) <EOL> self . assertGreaterEqual ( new_crop . box . w , <NUM_LIT> , <EOL> "<STR_LIT>" % new_crop . box . w ) </s>
