From 2d2ac618f8538fe243c292540fedfbf45e19b118 Mon Sep 17 00:00:00 2001 From: Sastry Isukapalli Date: Sun, 11 Feb 2018 21:09:32 -0500 Subject: Removed unused DB-adapters, test cases, 60+% cover We are not using OracleDB, PostgresDB, and VerticaDB, so there is no need to keep the "dead code" -- we can always add it back as needed. Added test cases so that all the files are at least minimally covered. Overall coverage on my local tox shows 66% coverage (I manually ensured all files are included in the coverage report). Issue-ID: OPTFRA-95 Change-Id: If1cab112236b4f32a96315308ce815088fa092d1 Signed-off-by: Sastry Isukapalli --- osdf/models/api/placementRequest.py | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'osdf/models') diff --git a/osdf/models/api/placementRequest.py b/osdf/models/api/placementRequest.py index 73eac75..df5f931 100644 --- a/osdf/models/api/placementRequest.py +++ b/osdf/models/api/placementRequest.py @@ -17,8 +17,8 @@ # from .common import OSDFModel -from schematics.types import StringType, URLType, IntType, FloatType -from schematics.types.compound import ModelType, ListType +from schematics.types import BaseType, StringType, URLType, IntType +from schematics.types.compound import ModelType, ListType, DictType class RequestInfo(OSDFModel): @@ -27,7 +27,7 @@ class RequestInfo(OSDFModel): requestId = StringType(required=True) callbackUrl = URLType(required=True) sourceId = StringType(required=True) - optimizer = ListType(StringType()) + optimizers = ListType(StringType(required=True)) numSolutions = IntType() timeout = IntType() requestType = StringType() @@ -47,7 +47,6 @@ class ResourceModelInfo(OSDFModel): modelVersion = StringType() modelVersionId = StringType() modelType = StringType() - operationalStatus = StringType() class ExistingLicenseInfo(OSDFModel): @@ -70,10 +69,9 @@ class PlacementDemand(OSDFModel): exclusionCandidateInfo = ListType(ModelType(CandidateInfo)) requiredCandidateInfo = ListType(ModelType(CandidateInfo)) resourceModelInfo = ModelType(ResourceModelInfo) - tenantId = StringType() + tenantId = StringType(required=True) tenantName = StringType() - class ExistingPlacementInfo(OSDFModel): serviceInstanceId = StringType(required=True) @@ -100,22 +98,15 @@ class ServiceModelInfo(OSDFModel): modelVersion = StringType(required=True) -class Location(OSDFModel): - latitude = FloatType(required=True) - longitude = FloatType(required=True) - - class PlacementInfo(OSDFModel): """Information specific to placement optimization""" - serviceModelInfo = ModelType(ServiceModelInfo) - subscriberInfo = ModelType(SubscriberInfo) + serviceModelInfo = ModelType(ServiceModelInfo, required=True) + subscriberInfo = ModelType(SubscriberInfo, required=True) demandInfo = ModelType(DemandInfo, required=True) - orderInfo = StringType() + requestParameters = DictType(BaseType) policyId = ListType(StringType()) - serviceInstanceId = StringType() + serviceInstanceId = StringType(required=True) existingPlacement = ModelType(ExistingPlacementInfo) - location = ModelType(Location) - serviceType = StringType() class PlacementAPI(OSDFModel): -- cgit 1.2.3-korg