def test_VIS_005_1_1(self): """ VIS-005-1-1 - In VIS-2, search for VIS with MMSI=12345678 """ response = service.search('mmsi:12345678') service.reportrow('VIS005sheet', 'VIS_005_1_1_row', 'VIS_005_1_1_col', response.status_code == 200, response.reason) self.assert200(response, "Response body is : " + response.text)
def test_VIS_010_0_06(self): """ VIS-010-6 - Find keyword service """ response = service.search('keywords:service') service.reportrow('VIS010sheet', 'VIS_010_06_row', 'VIS_010_06_col', response.status_code == 200, response.reason) self.assert200(response, "Response body is : " + response.text)
def test_VIS_010_0_07(self): """ VIS-010-7 - Find IMO 8719188 """ response = service.search('imo:8719188') service.reportrow('VIS010sheet', 'VIS_010_07_row', 'VIS_010_07_col', response.status_code == 200, response.reason) self.assert200(response, "Response body is : " + response.text)
def test_VIS_010_0_13(self): """ VIS-010-13 - Find Enhanced monitoring service to consume """ response = service.search('serviceType AND EMS') service.reportrow('VIS010sheet', 'VIS_010_13_row', 'VIS_010_13_col', response.status_code == 200, response.reason) self.assert200(response, "Response body is : " + response.text)
def test_VIS_010_0_02(self): """ VIS-010-2 - Find keyword ROS+SSPA """ response = service.search('keywords:ROS AND keywords:SSPA') service.reportrow('VIS010sheet', 'VIS_010_02_row', 'VIS_010_02_col', response.status_code == 200, response.reason) self.assert200(response, "Response body is : " + response.text)
def test_VIS_010_0_12(self): """ VIS-010-12 - Find Route check service to consume """ response = service.search('serviceType AND RCS') service.reportrow('VIS010sheet', 'VIS_010_12_row', 'VIS_010_12_col', response.status_code == 200, response.reason) self.assert200(response, "Response body is : " + response.text)
def test_VIS_010_0_10(self): """ VIS-010-10 - Find IMO 8719188 + Keyword ROS """ response = service.search('imo:8719188 AND keywords:ROS') service.reportrow('VIS010sheet', 'VIS_010_10_row', 'VIS_010_10_col', response.status_code == 200, response.reason) self.assert200(response, "Response body is : " + response.text)
def test_VIS_010_0_09(self): """ VIS-010-9 - Find ship by serviceType """ response = service.search('serviceType') service.reportrow('VIS010sheet', 'VIS_010_09_row', 'VIS_010_09_col', response.status_code == 200, response.reason) self.assert200(response, "Response body is : " + response.text)
def test_VIS_010_0_08(self): """ VIS-010-8 - Find ship by MMSI """ response = service.search('mmsi') service.reportrow('VIS010sheet', 'VIS_010_08_row', 'VIS_010_08_col', response.status_code == 200, response.reason) self.assert200(response, "Response body is : " + response.text)
if os.path.exists(fname): os.remove(fname) fname = 'import/text.dat' if os.path.exists(fname): os.remove(fname) all_data = [] parameters = { 'query': 'designID="urn:mrn:stm:service:design:sma:vis-rest-2.2" +VTS -SHIP', 'size': 1000, 'sort': 'name,desc', 'sort': 'id' } ret = service.search(None, params=parameters) data = json.loads(ret.text) shore_set = [] for item in sorted(data, key=methodcaller('get', 'name', None)): if item['status'] != 'released': pass else: shore_data = collections.OrderedDict() shore_data['name'] = item['name'] shore_data['endpointUri'] = item['endpointUri'].rstrip('/') shore_data['instanceId'] = item['instanceId'] shore_data['status'] = item['status'] shore_set.append(shore_data) all_data.append(shore_data) print('VTS', item['name']) with open('import/vts.dat', 'w') as f: