Skip to content

Commit

Permalink
temp fix for python runtime test
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasvanmol committed Jan 17, 2025
1 parent 9aae75a commit 621d940
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deathstar/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@ def recommend(req_param=None):

return Event(recommend_op.dataflow.entry, ["tempkey"], {"requirement": req_param, "lat": lat, "lon": lon}, recommend_op.dataflow)

def user_login():
def user_login(succesfull=True):
user_id = random.randint(0, 500)
username = f"Cornell_{user_id}"
password = str(user_id) * 10
password = str(user_id) * 10 if succesfull else ""
return Event(OpNode(user_op, InvokeMethod("login")), [username], {"password": password}, None)

def reserve():
Expand Down
4 changes: 4 additions & 0 deletions deathstar/test_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,16 @@ def test_deathstar_demo_python():
event = user_login()
result = client.send(event)
assert result == True
event = user_login(succesfull=False)
result = client.send(event)
assert result == False

print("testing reserve")
event = reserve()
result = client.send(event)
assert result == True

return
print("testing search")
event = search_hotel()
result = client.send(event)
Expand Down

0 comments on commit 621d940

Please sign in to comment.