def _create_fake_infrastructure_and_flavor(): with flavorsync.app.app_context(): manager = DatabaseManager() flavor = util.create_secondary_example_flavor() manager.register_infrastructure(flavor.nodes[0]) manager.create_flavor(flavor) return flavor.id
def flavor_collection_extend_list_test(): flavor1 = util.create_example_flavor() flavor2 = util.create_secondary_example_flavor() flavor_collection1 = FlavorCollection([]) flavor_collection2 = FlavorCollection([flavor1]) flavor_collection3 = FlavorCollection([flavor2]) flavors = [flavor1] flavor_collection1.extend(flavor_collection2) assert flavor_collection1.flavors == flavors flavors = [flavor1, flavor2] flavor_collection1.extend(flavor_collection3) assert flavor_collection1.flavors == flavors