Skip to content

Commit

Permalink
Merge pull request #80 from Capstone-Projects-2024-Spring/Gao
Browse files Browse the repository at this point in the history
Fixed test case for table and update requirements.
  • Loading branch information
Dem0nMaxwell committed May 1, 2024
2 parents f5de65b + 86d1f4b commit a2575e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Binary file modified requirements.txt
Binary file not shown.
6 changes: 3 additions & 3 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,13 @@ def test_data_table(self, sample_user_info, cleanup):
random_user_data = {
'_username': sample_user_info['_username'],
'_email': sample_user_info['_email'],
'_history_highest_race_wpm': random.randint(50, 100),
'_top_wpm': random.randint(50, 100),
'_accuracy': round(random.uniform(80, 100), 2),
'_wins': random.randint(0, 100),
'_losses': random.randint(0, 100),
'_freq_mistyped_words': '|'.join(random.choices(["word1", "word2", "word3", "word4", "word5"], k=3)),
'_total_playing_time': random.randint(0, 1000),
'_play_date': datetime.now()
# '_play_date': datetime.now()
}

Database.insert(UserData, **random_user_data)
Expand All @@ -239,7 +239,7 @@ def test_data_table(self, sample_user_info, cleanup):
# Assert individual attributes of user_data object
assert user_data._username == sample_user_info['_username']
assert user_data._email == sample_user_info['_email']
assert user_data._history_highest_race_wpm == random_user_data['_history_highest_race_wpm']
assert user_data._top_wpm == random_user_data['_top_wpm']
assert float(user_data._accuracy) == random_user_data['_accuracy']
assert user_data._wins == random_user_data['_wins']
assert user_data._losses == random_user_data['_losses']
Expand Down

0 comments on commit a2575e7

Please sign in to comment.