Example #1
0
    def test_all(self):
        """Test table button"""
        self.table_name = self.ui.table_name.currentText()
        from poker.scraper.table_scraper import TableScraper
        table_dict = mongo.get_table(table_name=self.table_name)

        table_scraper = TableScraper(table_dict)
        table_scraper.nn_model = None

        if 'use_neural_network' in table_dict and table_dict['use_neural_network'] == '2':
            from tensorflow.keras.models import model_from_json
            table_scraper.nn_model = model_from_json(table_dict['_model'])
            mongo.load_table_nn_weights(self.table_name)
            table_scraper.nn_model.load_weights(get_dir('codebase') + '/loaded_model.h5')

        table_scraper.screenshot = self.original_screenshot
        table_scraper.crop_from_top_left_corner()
        table_scraper.is_my_turn()
        table_scraper.lost_everything()
        table_scraper.get_my_cards2()
        table_scraper.get_table_cards2()
        table_scraper.get_dealer_position2()
        table_scraper.get_players_in_game()
        table_scraper.get_pots()
        table_scraper.get_players_funds()
        table_scraper.get_player_pots()
        table_scraper.get_call_value()
        table_scraper.get_raise_value()
        table_scraper.has_all_in_call_button()
        table_scraper.has_call_button()
        table_scraper.has_raise_button()
        table_scraper.has_bet_button()
        log.info("Test finished.")
Example #2
0
def test_table_scraper():
    mongo = MongoManager()
    table_dict = mongo.get_table("PartyPoker Old")
    table_scraper = TableScraper(table_dict)
    table_scraper.screenshot = Image.open(
        os.path.join(get_dir('tests', 'screenshots'),
                     '53269218_PreFlop_0.png'))
    table_scraper.crop_from_top_left_corner()
    table_scraper.is_my_turn()
    table_scraper.lost_everything()
    table_scraper.get_my_cards2()
    table_scraper.get_table_cards2()
    table_scraper.get_dealer_position2()
    table_scraper.get_players_in_game()
    table_scraper.get_pots()
    table_scraper.get_players_funds()
    table_scraper.get_call_value()
    table_scraper.get_raise_value()
    table_scraper.has_all_in_call_button()
    table_scraper.has_call_button()
    table_scraper.has_raise_button()
Example #3
0
 def test_all(self):
     """Test table button"""
     self.table_name = self.ui.table_name.currentText()
     from poker.scraper.table_scraper import TableScraper
     table_dict = mongo.get_table(table_name=self.table_name)
     table_scraper = TableScraper(table_dict)
     table_scraper.screenshot = self.original_screenshot
     table_scraper.crop_from_top_left_corner()
     table_scraper.is_my_turn()
     table_scraper.lost_everything()
     table_scraper.get_my_cards2()
     table_scraper.get_table_cards2()
     table_scraper.get_dealer_position2()
     table_scraper.get_players_in_game()
     table_scraper.get_pots()
     table_scraper.get_players_funds()
     table_scraper.get_call_value()
     table_scraper.get_raise_value()
     table_scraper.has_all_in_call_button()
     table_scraper.has_call_button()
     table_scraper.has_raise_button()