Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_find_best_response_to_play_count():
M = np.array([[3, 2, 3], [4, 1, 1], [2, 3, 1]])
play_counts = (
np.array([1, 0, 0]),
np.array([2, 1, 0]),
np.array([0, 0, 2]),
)
best_responses = (1, 1, 0)
for play_count, expected_best_response in zip(play_counts, best_responses):
best_response = get_best_response_to_play_count(M, play_count)
assert best_response == expected_best_response, play_count
def test_property_find_best_response_to_play_count(M):
play_count = np.zeros(M.shape[1])
best_response = get_best_response_to_play_count(M, play_count)
assert best_response >= 0
assert best_response <= M.shape[1] - 1
assert (type(best_response) is np.int64) or (
type(best_response) is np.int32
) # For testing purposes on Windows