Skip to content

Commit 3e3f323

Browse files
committed
Update to https and test
1 parent 5a5f4d0 commit 3e3f323

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

pybomwater/bom_water.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class Action:
2727
def __init__(self):
2828
pass
2929

30-
# GetDescribeSensor = 'http://www.bom.gov.au/waterdata/services?service=SOS&version=2.0&request=DescribeSensor'
31-
GetCapabilities = 'http://www.bom.gov.au/waterdata/services?service=SOS&version=2.0&request=GetCapabilities'
30+
# GetDescribeSensor = 'https://www.bom.gov.au/waterdata/services?service=SOS&version=2.0&request=DescribeSensor'
31+
GetCapabilities = 'https://www.bom.gov.au/waterdata/services?service=SOS&version=2.0&request=GetCapabilities'
3232
GetDataAvailability = "http://www.opengis.net/def/serviceOperation/sos/daRetrieval/2.0/GetDataAvailability"
3333
GetObservation = "http://www.opengis.net/def/serviceOperation/sos/core/2.0/GetObservation"
3434
GetFeatureOfInterest = "http://www.opengis.net/def/serviceOperation/sos/foiRetrieval/2.0/GetFeatureOfInterest"
@@ -224,15 +224,15 @@ def build_payload(self, action, feature=None, prop=None, proced=None, begin=None
224224

225225
# def request(self, action, feature=None, prop=None, proced=None, begin=None, end=None, lower_corner=None,
226226
# upper_corner=None):
227-
# endpoint = f"http://www.bom.gov.au/waterdata/services?service=SOS&version=2.0&request={os.path.basename(action)}"
227+
# endpoint = f"https://www.bom.gov.au/waterdata/services?service=SOS&version=2.0&request={os.path.basename(action)}"
228228
# payload = self.build_payload(action, feature, prop, proced, begin, end, lower_corner, upper_corner)
229229
# if action == Action.GetCapabilities:
230230
# return requests.get(action)
231231
# return requests.post(endpoint, payload)
232232

233233
def request(self, action, feature=None, prop=None, proced=None, begin=None, end=None, lower_corner=None, upper_corner=None):
234234
try:
235-
endpoint = f"http://www.bom.gov.au/waterdata/services?service=SOS&version=2.0&request={os.path.basename(action)}"
235+
endpoint = f"https://www.bom.gov.au/waterdata/services?service=SOS&version=2.0&request={os.path.basename(action)}"
236236
payload = self.build_payload(action, feature, prop, proced, begin, end, lower_corner, upper_corner)
237237
if action == Action.GetCapabilities:
238238
response = requests.get(action)

test/test_core.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,9 @@ def test_get_feature_of_interest(self):
7979
'''Get Feature of interest test'''
8080
_bm = bm.BomWater()
8181
'''Todo: Need a small bounding box with known stations contained'''
82-
response = _bm.request(_bm.actions.GetFeatureOfInterest,
83-
"http://bom.gov.au/waterdata/services/stations/GW036501.2.2")
82+
response = _bm.request(_bm.actions.GetFeatureOfInterest, "http://bom.gov.au/waterdata/services/stations/GW036501.2.2")
8483
test_json = _bm.xml_to_json(response.text)#, f'test_GetFeatureOfInterest.json')
85-
features = test_json['soap12:Envelope']['soap12:Body']['sos:GetFeatureOfInterestResponse'][
86-
'sos:featureMember']
84+
features = test_json['soap12:Envelope']['soap12:Body']['sos:GetFeatureOfInterestResponse']['sos:featureMember']
8785
long_statioId = features['wml2:MonitoringPoint']['gml:identifier']['#text']
8886
if os.path.basename(long_statioId) == 'GW036501.2.2':
8987
assert True, "Test GetFeatureOfInterest passed"

0 commit comments

Comments
 (0)