def test_choose_a_random_game_to_play_returns_a_game(self): game_found, game_to_play = playtime.choose_a_random_game_to_play(False, False) if game_found: self.assertTrue(isinstance(game_to_play, str)) else: self.assertIsNone(game_to_play)
def test_can_retrieve_an_installed_game_thats_never_been_played(self): game_found, game_to_play = playtime.choose_a_random_game_to_play(True, True) if game_found: self.assertTrue(isinstance(game_to_play, str)) else: self.assertIsNone(game_to_play)
parser.add_argument( '-np', '--never-played', dest='never_played', action='store_true', help='Only returns games you\'ve never played' ) parser.add_argument( '-i', '--installed', dest='installed', action='store_true', help='Only returns games that are currently installed' ) return parser.parse_args() if __name__ == '__main__': args = get_cmd_arguments() game_found, game_to_play = playtime.choose_a_random_game_to_play( args.never_played, args.installed ) if not game_found: print('Couldn\'t find a game to play!') else: print('You should totally play: "' + game_to_play + '"') input()