def test_table_and_my_cards63(): # ok log = logging.getLogger(__name__) mongo = MongoManager() table_dict = mongo.get_table('GG_6TABLE') table_scraper = TableScraper(table_dict) table_scraper.screenshot = Image.open( os.path.join(os.environ['test_4table'], '1.png')) table_scraper.crop_from_top_left_corner2(select_table=2) table_scraper.get_table_cards3() print(table_scraper.table_cards) assert set(table_scraper.table_cards) == {'AH', 'TH', '4D'}
def test_table_and_my_cards11(): # ok log = logging.getLogger(__name__) mongo = MongoManager() table_dict = mongo.get_table('GG_6TABLE') table_scraper = TableScraper(table_dict) table_scraper.screenshot = Image.open( os.path.join(os.environ['test_src'], '2.png')) table_scraper.crop_from_top_left_corner2(select_table=1) table_scraper.get_table_cards3() print(table_scraper.table_cards) assert set(table_scraper.table_cards) == {'QS', '8C', '5H', '8D'} # Miss 6H -> 8C
def test_table_and_my_cards58(): # ok log = logging.getLogger(__name__) mongo = MongoManager() table_dict = mongo.get_table('GG_6TABLE') table_scraper = TableScraper(table_dict) table_scraper.screenshot = Image.open( os.path.join(os.environ['test_src'], '20.png')) table_scraper.crop_from_top_left_corner2(select_table=4) table_scraper.get_table_cards3() print(table_scraper.table_cards) assert set(table_scraper.table_cards) == {'7D', 'QC', 'JH', '7S', 'AH'} # Passed
def test_table_and_my_cards24(): # ok log = logging.getLogger(__name__) mongo = MongoManager() table_dict = mongo.get_table('GG_6TABLE') table_scraper = TableScraper(table_dict) table_scraper.screenshot = Image.open( os.path.join(os.environ['test_test'], '4.png')) table_scraper.crop_from_top_left_corner2(select_table=1) table_scraper.get_table_cards3() print(table_scraper.table_cards) assert set(table_scraper.table_cards) == {'KS', '3D', '4S', 'AS' } # Miss AS => Passed by resize
def test_table_and_my_cards16(): # ok log = logging.getLogger(__name__) mongo = MongoManager() table_dict = mongo.get_table('GG_6TABLE') table_scraper = TableScraper(table_dict) table_scraper.screenshot = Image.open( os.path.join(os.environ['test_test'], '2.png')) table_scraper.crop_from_top_left_corner2(select_table=1) table_scraper.get_table_cards3() print(table_scraper.table_cards) assert set(table_scraper.table_cards) == {'7S', '6H', '4D', '6S', '8S'} # Additional 8H
def test_table_and_my_cards30(): # ok log = logging.getLogger(__name__) mongo = MongoManager() table_dict = mongo.get_table('GG_6TABLE') table_scraper = TableScraper(table_dict) table_scraper.screenshot = Image.open( os.path.join(os.environ['test_test'], '5.png')) table_scraper.crop_from_top_left_corner2(select_table=4) table_scraper.get_table_cards3() print(table_scraper.table_cards) assert set(table_scraper.table_cards) == { '3C', '5C', '7S', '2D' } # Miss 3C, 5C => FIXED BY UPDATE SIZE
def test_table_and_my_cards64(): # ok log = logging.getLogger(__name__) mongo = MongoManager() table_dict = mongo.get_table('GG_6TABLE') table_scraper = TableScraper(table_dict) table_scraper.screenshot = Image.open( os.path.join(os.environ['test_4table'], '2.png')) table_scraper.crop_from_top_left_corner2(select_table=0) # config = get_config() # table_size = config['DEFAULT']['table_size'] # log.info(f'table_size:{table_size}') # scale_m = scale_cal(table_size, 'table_cards_area') # log.info(f'scale_m:{scale_m}') table_scraper.get_table_cards3() print(table_scraper.table_cards) assert set(table_scraper.table_cards) == {'4C', '6S', '4H', '7C', 'QD'}