Skip to content

Commit

Permalink
test: changed main to manually test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
shanto268 committed Jul 27, 2024
1 parent e9eab79 commit 78491a0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion duty_tracker.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"presentation": "10",
"maintenance": "11",
"maintenance": "10",
"snacks": "11"
}
19 changes: 18 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,21 @@ def alert_developer(e):
content = f"System Generated Error Message:\n{bar}\n\n{str(e)}\n\nResolutions:\n{bar}\n\n{resolution_msg}"
email_notifier.send_email([__email__], "Lab Notification System Error", content)

def test_update_duty_tracker(system):
"""Test function to update the duty tracker and push changes."""
print("Running test to update duty tracker...")

# Simulate updating the duty tracker
duty_type = "presentation"
next_member_id = "test_member_id"
system.update_duty_tracker(duty_type, next_member_id)

# Verify the update
with open('duty_tracker.json', 'r') as file:
tracker = json.load(file)
assert tracker[duty_type] == next_member_id
print("Duty tracker update test passed.")

if __name__ == "__main__":
presentation_day = "Monday"
presentation_time = "10:00 AM"
Expand All @@ -370,7 +385,9 @@ def alert_developer(e):
alert_developer(e)
sys.exit(1)
try:
system.run()
#system.run()
# Run the test case
test_update_duty_tracker(system)
except Exception as e:
print(f"Caught exception during execution: {e}")
alert_developer(e)
Expand Down

0 comments on commit 78491a0

Please sign in to comment.