def testCreation( self ):
		
		# Create a node to make sure that we have a default format...
		s = Gaffer.ScriptNode()
		n = GafferImage.Grade()
		s.addChild( n )
		
		# Get the format names
		formatNames = GafferImage.Format.formatNames()
		
		# Create the plug's ui element.
		fw = GafferImageUI.FormatPlugValueWidget( s["defaultFormat"], lazy=False )
		
		# Now compare the format names against those in the UI element.
		self.assertEqual( len( fw ), len( formatNames ) )
	def testAccessors( self ) :
		
		# Create a node to make sure that we have a default format...
		s = Gaffer.ScriptNode()
		n = GafferImage.Grade()
		s.addChild( n )
		
		# Create the plug's ui element.
		fw = GafferImageUI.FormatPlugValueWidget( s["defaultFormat"], lazy=False )
		
		# Test the accessors
		formatNameAndValue = fw[0]
		self.assertTrue( isinstance( formatNameAndValue[0], str ) )
		self.assertTrue( isinstance( formatNameAndValue[1], GafferImage.Format ) )
		self.assertEqual( fw[ formatNameAndValue[0] ], formatNameAndValue[1] )
		self.assertEqual( fw[ formatNameAndValue[1] ], formatNameAndValue[0] )