<s> import mock <EOL> from oslotest import base <EOL> from cloudferry import cfglib <EOL> from cloudferry . cloud import cloud <EOL> class TestCase ( base . BaseTestCase ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> super ( TestCase , self ) . __init__ ( * args , ** kwargs ) <EOL> self . cfg = cfglib . CONF <EOL> cfglib . init_config ( ) <EOL> def override_config ( self , options ) : <EOL> for group in options : <EOL> for name , value in options [ group ] . items ( ) : <EOL> self . cfg . set_override ( name = name , override = value , group = group ) <EOL> def cloud_config ( self , position ) : <EOL> return cloud . Cloud . make_cloud_config ( self . cfg , position ) <EOL> def setUp ( self ) : <EOL> super ( TestCase , self ) . setUp ( ) <EOL> self . addCleanup ( mock . patch . stopall ) <EOL> self . addCleanup ( self . cfg . reset ) <EOL> def assertIsZero ( self , observed , message = '<STR_LIT>' ) : <EOL> self . assertEqual ( <NUM_LIT:0> , observed , message ) <EOL> def assertCalledOnce ( self , mock_obj , message = '<STR_LIT>' ) : <EOL> message = message or ( "<STR_LIT>" <EOL> "<STR_LIT>" % ( mock_obj , <EOL> mock_obj . call_count ) ) <EOL> self . assertEqual ( <NUM_LIT:1> , mock_obj . call_count , message ) </s>
