#NEWLINE# def test_sensor_create( self , mock_registry ) : #NEWLINE# #INDENT# data = { #NEWLINE# #INDENT# 'name' : 'new_name' , #NEWLINE# 'uuid' : 'input_uuid' , #NEWLINE# #UNINDENT# } #NEWLINE# db_obj = fakes . FakeSensor ( ) #NEWLINE# mock_registry . Sensor . return_value = self #NEWLINE# handler = sensor . SensorHandler ( self . ctx ) #NEWLINE# res = handler . create ( data ) #NEWLINE# db_obj . update . assert_called_once_with ( data ) #NEWLINE# db_obj . create . assert_called_once_with ( self . ctx ) #NEWLINE# self . assertEqual ( res , db_obj )