def testOverwrite( self ) :

		r = GafferImage.ImageReader()
		r["fileName"].setValue( self.checkerFile )
		inMetadata = r["out"]["metadata"].getValue()

		a = GafferImage.ImageMetadata()
		a["metadata"].addMember( "compression", IECore.StringData( "extraFancyCompressor" ) )

		m = GafferImage.CopyImageMetadata()
		m["in"].setInput( r["out"] )
		m["copyFrom"].setInput( a["out"] )

		# check that the image is passed through

		m["names"].setValue( "" )
		metadata = m["out"]["metadata"].getValue()
		self.assertEqual( metadata["compression"], IECore.StringData( "zips" ) )
		self.assertEqual( m["out"]["metadata"].getValue(), inMetadata )
		self.assertEqual( m["out"].image(), r["out"].image() )

		# check that we can overwrite certain metadata

		m["names"].setValue( "compression" )
		metadata = m["out"]["metadata"].getValue()
		self.assertTrue( "compression" in metadata.keys() )
		self.assertEqual( metadata["compression"], IECore.StringData( "extraFancyCompressor" ) )
dataset/ETHPy150Open ImageEngine/gaffer/python/GafferImageTest/CopyImageMetadataTest.py/CopyImageMetadataTest.testOverwrite/original