def testValidateDateFormat(self): schema = loadSchemaFor("ReservationRequest") request = reservationRequest() request['availabilityReportDate'] = "xyz" try: validateWithChecker(request, schema) self.fail() except ValidationError as e: print e.message pass
def testValidateContactResponse(self): schema = loadSchemaFor("Contact") requiredList = schema['definitions']['Contact']['required'] requiredList.append("status") requiredList.append("processedTime") processedTime = datetimeAsIso8601(dt.now()) data = { "id": "SkySat-A-rev1006-Fairbanks-1", "satelliteName": "SkySat-1", "startTime": "2014-10-10T07:28:20.000Z", "stopTime": "2014-10-10T07:29:20.000Z", "status": "RESERVED", "processedTime": processedTime } validateWithChecker(data, schema)
def testValidateContactResponse(self): schema = loadSchemaFor("Contact") requiredList = schema['definitions']['Contact']['required'] requiredList.append("status") requiredList.append("processedTime") processedTime = datetimeAsIso8601(dt.now()) data = { "id":"SkySat-A-rev1006-Fairbanks-1", "satelliteName":"SkySat-1", "startTime": "2014-10-10T07:28:20.000Z", "stopTime": "2014-10-10T07:29:20.000Z", "status" : "RESERVED", "processedTime" : processedTime } validateWithChecker(data, schema)
def testValidateReservationRequest(self): schema = loadSchemaFor("ReservationRequest") request = reservationRequest() validateWithChecker(request, schema)