PoeTrade/tests/test_keyboard.py

77 lines
3.1 KiB
Python

from src import sendkeys
from src import config
from src import data
def test_sendkeys():
config.read_config(r'config.yaml')
sendkeys.send_text('Hello World')
def test_inv():
conf = config.read_config(r'config.yaml')
data.compile_regex(conf)
text = '2021/03/08 23:24:52 17931875 bb3 [INFO Client 1492] @From Sinusal: Hi, I would like to buy your level 21 23% Vaal Impurity of Lightning ' \
'listed for 18 chaos in Ritual (stash tab "$"; position: left 22, top 5)'
message = data.Message.from_text(text)
sendkeys.invite(message)
def test_send_to():
config.read_config(r'config.yaml')
text = 'Hi, I would like to buy your level 21 23% Vaal Impurity of Lightning ' \
'listed for 18 chaos in Ritual (stash tab "$"; position: left 22, top 5)'
# sendkeys.send_to('Sinusal', 'Your item level 21 23% Vaal Impurity of Lightning for 18 chaos is ready to pickup.')
sendkeys.send_to('Sinusal', text)
def test_send_to2():
config.read_config(r'config.yaml')
text = 'Hi, I would like to buy your Watcher\'s Eye ' \
'listed for 7 Exalt in Ritual (stash tab "$"; position: left 25, top 1)'
sendkeys.send_to('Sinusal', text)
def test_pickup():
conf = config.read_config(r'config.yaml')
data.compile_regex(conf)
text = '2021/03/08 23:24:52 17931875 bb3 [INFO Client 1492] @From Sinusal: Hi, I would like to buy your level 21 23% Vaal Impurity of Lightning ' \
'listed for 18 chaos in Ritual (stash tab "$"; position: left 22, top 5)'
message = data.Message.from_text(text)
sendkeys.send_to_format('pickup', message)
def test_wait():
conf = config.read_config(r'config.yaml')
data.compile_regex(conf)
text = '2021/03/08 23:24:52 17931875 bb3 [INFO Client 1492] @From Sinusal: Hi, I would like to buy your level 21 23% Vaal Impurity of Lightning ' \
'listed for 18 chaos in Ritual (stash tab "$"; position: left 22, top 5)'
message = data.Message.from_text(text)
sendkeys.send_to_format('wait', message)
def test_ty():
conf = config.read_config(r'config.yaml')
data.compile_regex(conf)
text = '2021/03/08 23:24:52 17931875 bb3 [INFO Client 1492] @From Sinusal: Hi, I would like to buy your level 21 23% Vaal Impurity of Lightning ' \
'listed for 18 chaos in Ritual (stash tab "$"; position: left 22, top 5)'
message = data.Message.from_text(text)
sendkeys.send_to_format('ty', message)
def test_sold():
conf = config.read_config(r'config.yaml')
data.compile_regex(conf)
text = '2021/03/08 23:24:52 17931875 bb3 [INFO Client 1492] @From Sinusal: Hi, I would like to buy your level 21 23% Vaal Impurity of Lightning ' \
'listed for 18 chaos in Ritual (stash tab "$"; position: left 22, top 5)'
message = data.Message.from_text(text)
sendkeys.send_to_format('sold', message)
def test_ty_wo_trade():
conf = config.read_config(r'config.yaml')
data.compile_regex(conf)
text = '2021/03/08 23:24:52 17931875 bb3 [INFO Client 1492] @From Sinusal: Hi, how are you doing? '
message = data.Message.from_text(text)
sendkeys.send_to_format('ty', message)