#NEWLINE# @ mock . patch . object ( versioning_api , 'version_control' ) #NEWLINE# def test_db_version_raise_not_controlled_error_no_tables( self , mock_vc ) : #NEWLINE# #INDENT# with mock . patch . object ( sqlalchemy , 'MetaData' ) as mock_meta : #NEWLINE# #INDENT# self . mock_api_db_version . side_effect = ( migrate_exception . DatabaseNotControlledError ( 'oups' ) , self . init_version ) #NEWLINE# my_meta = mock . MagicMock ( ) #NEWLINE# my_meta . tables = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# mock_meta . return_value = my_meta #NEWLINE# migration . db_version ( self . engine , self . path , self . init_version ) #NEWLINE# mock_vc . assert_called_once_with ( self . engine , self . return_value1 , self . init_version )