<s> import mock <EOL> from tripleo_common . image . exception import ImageBuilderException <EOL> from tripleo_common . image . image_builder import DibImageBuilder <EOL> from tripleo_common . image . image_builder import ImageBuilder <EOL> from tripleo_common . tests import base <EOL> class TestImageBuilder ( base . TestCase ) : <EOL> def test_get_builder_dib ( self ) : <EOL> builder = ImageBuilder . get_builder ( '<STR_LIT>' ) <EOL> assert isinstance ( builder , DibImageBuilder ) <EOL> def test_get_builder_unknown ( self ) : <EOL> self . assertRaises ( ImageBuilderException , ImageBuilder . get_builder , <EOL> '<STR_LIT>' ) <EOL> class TestDibImageBuilder ( base . TestCase ) : <EOL> def setUp ( self ) : <EOL> super ( TestDibImageBuilder , self ) . setUp ( ) <EOL> self . builder = DibImageBuilder ( ) <EOL> @ mock . patch ( '<STR_LIT>' ) <EOL> def test_build_image ( self , mock_check_call ) : <EOL> self . builder . build_image ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> [ '<STR_LIT>' , '<STR_LIT>' ] , [ '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' ] , <EOL> { '<STR_LIT>' : True , <EOL> '<STR_LIT>' : '<STR_LIT>' } ) <EOL> mock_check_call . assert_called_once_with ( <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ] ) </s>
