<s> import os <EOL> import unittest <EOL> import IECore <EOL> import GafferUI <EOL> import GafferUITest <EOL> class ImageGadgetTest ( GafferUITest . TestCase ) : <EOL> def testConstructFromImagePrimitive ( self ) : <EOL> window = IECore . Box2i ( IECore . V2i ( <NUM_LIT:0> ) , IECore . V2i ( <NUM_LIT:255> ) ) <EOL> imagePrimitive = IECore . ImagePrimitive . createRGBFloat ( IECore . Color3f ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) , window , window ) <EOL> i = GafferUI . ImageGadget ( imagePrimitive ) <EOL> self . assertEqual ( i . bound ( ) , IECore . Box3f ( IECore . V3f ( - <NUM_LIT> , - <NUM_LIT> , <NUM_LIT:0> ) , IECore . V3f ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT:0> ) ) ) <EOL> def testConstructFromFile ( self ) : <EOL> i = GafferUI . ImageGadget ( "<STR_LIT>" ) <EOL> self . assertEqual ( i . bound ( ) , IECore . Box3f ( IECore . V3f ( - <NUM_LIT:5> , - <NUM_LIT:5> , <NUM_LIT:0> ) , IECore . V3f ( <NUM_LIT:5> , <NUM_LIT:5> , <NUM_LIT:0> ) ) ) <EOL> def testMissingFiles ( self ) : <EOL> self . assertRaises ( Exception , GafferUI . ImageGadget , "<STR_LIT>" ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
