<s> from nova . db . sqlalchemy import api_models <EOL> from nova . db . sqlalchemy import models <EOL> from nova import test <EOL> class FlavorTablesCompareTestCase ( test . NoDBTestCase ) : <EOL> def _get_columns_list ( self , model ) : <EOL> columns_list = [ m . key for m in model . __table__ . columns ] <EOL> return columns_list <EOL> def _check_column_list ( self , columns_new , columns_old ) : <EOL> columns_old . remove ( '<STR_LIT>' ) <EOL> columns_old . remove ( '<STR_LIT>' ) <EOL> intersect = set ( columns_new ) . intersection ( set ( columns_old ) ) <EOL> if intersect != set ( columns_new ) or intersect != set ( columns_old ) : <EOL> return False <EOL> return True <EOL> def test_tables_flavors_instance_types ( self ) : <EOL> flavors = api_models . Flavors ( ) <EOL> instance_types = models . InstanceTypes ( ) <EOL> columns_flavors = self . _get_columns_list ( flavors ) <EOL> columns_instance_types = self . _get_columns_list ( instance_types ) <EOL> self . assertTrue ( self . _check_column_list ( columns_flavors , <EOL> columns_instance_types ) ) <EOL> def test_tables_flavor_instance_type_extra_specs ( self ) : <EOL> flavor_extra_specs = api_models . FlavorExtraSpecs ( ) <EOL> instance_type_extra_specs = models . InstanceTypeExtraSpecs ( ) <EOL> columns_flavor_extra_specs = self . _get_columns_list ( flavor_extra_specs ) <EOL> columns_instance_type_extra_specs = self . _get_columns_list ( <EOL> instance_type_extra_specs ) <EOL> columns_flavor_extra_specs . remove ( '<STR_LIT>' ) <EOL> columns_instance_type_extra_specs . remove ( '<STR_LIT>' ) <EOL> self . assertTrue ( self . _check_column_list ( <EOL> columns_flavor_extra_specs , <EOL> columns_instance_type_extra_specs ) ) <EOL> def test_tables_flavor_instance_type_projects ( self ) : <EOL> flavor_projects = api_models . FlavorProjects ( ) <EOL> instance_types_projects = models . InstanceTypeProjects ( ) <EOL> columns_flavor_projects = self . _get_columns_list ( flavor_projects ) <EOL> columns_instance_type_projects = self . _get_columns_list ( <EOL> instance_types_projects ) <EOL> columns_flavor_projects . remove ( '<STR_LIT>' ) <EOL> columns_instance_type_projects . remove ( '<STR_LIT>' ) <EOL> self . assertTrue ( self . _check_column_list ( <EOL> columns_flavor_projects , <EOL> columns_instance_type_projects ) ) </s>
