예제 #1
0
def test_file_and_string_same(testdir):
    file_path = str(testdir.joinpath('handhistory/hand8.txt'))
    hh_file = PokerStarsHandHistory.from_file(file_path)
    hh_str = PokerStarsHandHistory(stars_hands.HAND8)
    print(bytes(hh_file.raw, encoding='utf-8'), '\n',
          bytes(hh_str.raw, encoding='utf-8'))
    #assert len(hh_file.raw) == len(hh_str.raw)
    #assert hh_file.raw == hh_str.raw
    hh_file._split_raw()
    hh_str._split_raw()
    print(hh_file._splitted, '\n', hh_str._splitted)
    assert hh_file._splitted == hh_str._splitted
예제 #2
0
def test_open_from_file(testdir):
    bbb_path = str(testdir.joinpath('handhistory/bbb.txt'))
    hh = PokerStarsHandHistory.from_file(bbb_path)
    hh.parse()
    assert hh.ident == '138364355489'
    assert type(hh.raw) is unicode
예제 #3
0
def test_open_from_file(testdir):
    bbb_path = str(testdir.joinpath('handhistory/bbb.txt'))
    hh = PokerStarsHandHistory.from_file(bbb_path)
    hh.parse()
    assert hh.ident == '138364355489'
    assert type(hh.raw) is unicode
예제 #4
0
def test_open_from_bb_file(test_dir):
    bbb_path = str(test_dir.joinpath("handhistory/bbb.txt"))
    hh = PokerStarsHandHistory.from_file(bbb_path)
    hh.parse()
    assert hh.ident == "138364355489"
    assert type(hh.raw) is str