Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #227 from COS301-SE-2023/Testing
Browse files Browse the repository at this point in the history
Testing
  • Loading branch information
Daniel-Radloff authored Sep 28, 2023
2 parents fa24298 + 0151d51 commit 23f14e4
Show file tree
Hide file tree
Showing 3 changed files with 285 additions and 283 deletions.
16 changes: 9 additions & 7 deletions api/scripts/fetchstatstest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

testing_endpoint = "http://127.0.0.1:8000/api/fetchSuburbStats"
testing_endpoint = "https://witpa.codelog.co.za/api/fetchSuburbStats"
schedule_endpoint = "https://witpa.codelog.co.za/api/fetchScheduleData"
schedule_endpoint = "http://127.0.0.1:8000/api/fetchScheduleData"
schedule_endpoint = "https://witpa.codelog.co.za/api/fetchScheduleData"
maponoff_endpoint = "https://witpa.codelog.co.za/api/fetchTimeForPolygon"
maponoff_endpoint = "http://127.0.0.1:8000/api/fetchTimeForPolygon"
def sendRequest():
body = {
Expand All @@ -20,7 +21,7 @@ def sendRequest():

def sendScheduleRequest():
body = {
#"suburbId" :18231
#"suburbId" :18231
"suburbId" : 18210
}
request = json.dumps(body)
Expand All @@ -32,20 +33,21 @@ def sendScheduleRequest():

def sendTimeForPolygonRequest():
body = {
#"suburbId" :18057
#"suburbId" : 18231
"suburbId" : 18195
#"suburbId" :18057
#"suburbId" : 18231
"suburbId" : 18196
}
print(body)
request = json.dumps(body)
headers = {
"Content-Type":"application/json"
}
response = requests.post(url=maponoff_endpoint,data=request,headers=headers)
print(response.text)
if (__name__ == "__main__"):
sendRequest()
#sendRequest()
print("=================================================================================")
sendScheduleRequest()
#sendScheduleRequest()
print("=================================================================================")
sendTimeForPolygonRequest()

2 changes: 1 addition & 1 deletion api/src/loadshedding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ impl TimeScheduleEntity {
self.stop_minute as u32
})
.unwrap();
if time < time_to_search {
if time < time_to_search && !start {
time = time.checked_add_signed(chrono::Duration::days(1)).unwrap();
}
time
Expand Down
Loading

0 comments on commit 23f14e4

Please sign in to comment.