diff options
author | Sastry Isukapalli <sastry@research.att.com> | 2018-02-11 21:09:32 -0500 |
---|---|---|
committer | Sastry Isukapalli <sastry@research.att.com> | 2018-02-11 21:16:26 -0500 |
commit | 2d2ac618f8538fe243c292540fedfbf45e19b118 (patch) | |
tree | f8dbb42efb35d7e79a56978dfbd2e2cb03cbe0e0 /osdf/models | |
parent | 0b855c08fd98fb8fa0f4bc40d8df430c897b4bad (diff) |
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 <sastry@research.att.com>
Diffstat (limited to 'osdf/models')
-rw-r--r-- | osdf/models/api/placementRequest.py | 25 |
1 files changed, 8 insertions, 17 deletions
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): |