def test_GameManagerInputs(self): """ Tests GameManager input data prompter and respondents and GET abilities of those props """ gameManager = GameManager("Jonathan", ["Omar", "Joey", "Salekh"]) self.assertEqual((str==type(gameManager.get_prompter()[0])), True) self.assertEqual((list==type(gameManager.get_respondents())), True)
def test_gamemanager_query_get(self): gameManager = GameManager("Jonathan", ["Omar", "Joey", "Salekh"]) q = gameManager.get_suggestions("dogfish") # Check that the keys() of answers received correspond to the respondents del q['Jonathan'] del q['if_valid'] self.assertEqual(sorted(q.keys()),sorted(gameManager.get_respondents())) # Check to see if suggestions are shuffled: p1, p2, p3 = q.keys() self.assertEqual( (q[p1] != q[p2] != q[p3]), True)
def test_GameManagerQueryGet(): """ Here we test the GameManager get_suggestions method We expect to see four answers (response from server) that are shuffled If they are not shuffled answers we will throw an error. """ gameManager = GameManager("Jonathan", ["Omar", "Joey", "Salekh"]) q = gameManager.get_suggestions("dogfish") # Check that the keys() of answers received correspond to the respondents del q['Jonathan'] del q['if_valid'] assert (sorted(q.keys()) == sorted(gameManager.get_respondents())) # Check to see if suggestions are shuffled: p1, p2, p3 = q.keys() assert (q[p1] != q[p2] != q[p3])
def test_inputs_mul(self): gameManager = GameManager("Jonathan", ["Omar", "Joey", "Salekh"]) self.assertEqual(str, type(gameManager.get_prompter()[0])) self.assertEqual(list, type(gameManager.get_respondents()))