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

Testing #227

Merged
merged 3 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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