コード例 #1
0
ファイル: tests.py プロジェクト: ChrisPWill/RitoPls
        res = oce.summoner_byname("Strat")
        self.assertEqual(res['strat']['name'], 'Strat')
        self.assertEqual(res['strat']['id'], 401477)

    def test_currentgame(self):
        if ingame is not None:
            response = oce.summoner_byname(ingame)
            info = next(iter(response.values()))
            sumid = info['id']
            self.setUp()
            currentgame = oce.currentgame(sumid)
            self.assertTrue(currentgame['gameLength'] > 0)

    def test_match(self):
        response = oce.match(113474328)
        self.assertEqual(response['matchType'], 'MATCHED_GAME')


class TestStaticEndPoints(unittest.TestCase):
    def test_champlist(self):
        res = oce.static_champion_list(data_by_id=True)
        self.assertEqual(res['data']["1"]["name"], "Annie")


if __name__ == "__main__":
    ingame = input("Enter an OCE summoner currently in a game: ")
    response = oce.summoner_byname(ingame)
    sumid = next(iter(response.values()))['id']
    notingame = input("Enter an OCE summoner currently NOT in a game: ")
    unittest.main()