def test_option_edit(self): """editPlayer() edits player with new info provided""" q = "SELECT * FROM matches ORDER BY id LIMIT 1" r = tools.query(q) s = str(r[0][0]) self.assertEquals(tournament.editPlayer(player=s, new_name="Johan Bach", new_country="Guam"), 0)
def test_edit_invalid_player_id(self): """editPlayer() should throw if the player ID is invalid""" with self.assertRaises(LookupError): tournament.editPlayer(player="0", new_name="Michael Bay", new_country="Japan")
def test_edit_missing_new_info(self): """editPlayer() throws when both new_name and new_country are not specified""" with self.assertRaises(AttributeError): tournament.editPlayer(new_name="Joan Jett")