Beispiel #1
0
 def test_get_rank_bot(self, mock_bracket):
     initialize_db_with_replays(self.replays)
     unranked_rank = get_empty_data(["b086f2d2abb"])
     rank = get_rank("b086f2d2abb")
     assert (unranked_rank[list(unranked_rank.keys())[0]].get('10') !=
             rank.get('10'))
     assert (unranked_rank[list(
         unranked_rank.keys())[0]].get('13') == rank.get('13'))
     assert (unranked_rank[list(
         unranked_rank.keys())[0]].get('11') == rank.get('11'))
Beispiel #2
0
 def test_get_player(self, mock_bracket):
     self.league.update_player_cache()
     initialize_db_with_replays(self.replays)
     bot = get_bot_by_steam_id("b086f2d2abb")
     assert (bot == "SkyBot")
     braacket_id = self.league.player_cache.get(bot)
     skybot_id = "54FB8C16-6FA9-4C4A-AAD5-3DB8A6AE169B"
     assert (braacket_id == skybot_id)
     ranking_info = self.league.get_ranking(braacket_id)
     assert (ranking_info is not None)
Beispiel #3
0
def initialize_database(temp_folder):
    session, protos, ids = initialize_db_with_replays(['3_KICKOFFS_4_SHOTS.replay'])

    class wrapper:
        def get_session(self):
            return session
        def get_protos(self):
            return protos
        def get_ids(self):
            return ids

    return wrapper()
 def setup_method(self, method):
     self.session, self.protos, self.guids = initialize_db_with_replays(
         [get_complex_replay_list()[0]])
     self.guid = self.guids[0]
     self.proto = self.protos[0]
 def setup_method(self):
     session, protos, ids = initialize_db_with_replays(
         ['crossplatform_party.replay'])
     self.replay_proto = protos[0]
     self.replay_id = ids[0]
Beispiel #6
0
 def test_get_bot_by_steam_id_allstars(self, mock_bracket):
     initialize_db_with_replays(self.replays)
     bot = get_bot_by_steam_id("bcfe70a272b")
     assert (bot == "Allstar")
     bot = get_bot_by_steam_id("b40b")
     assert (bot == "Allstar")
Beispiel #7
0
 def test_get_non_existing_bot(self, mock_bracket):
     initialize_db_with_replays(self.replays)
     assert (get_bot_by_steam_id("notABot") is None)
     assert (self.league.player_cache.get("notABot") is None)
     assert (self.league.get_ranking("notABot") is None)
     assert (get_bot_by_steam_id("bNotABotb") is None)