Use config yaml file

This commit is contained in:
2021-03-14 11:31:43 +01:00
parent 11bde6d597
commit 3c7c5c5f5d
7 changed files with 42 additions and 11 deletions

View File

@@ -1,9 +1,13 @@
from src import trader
from src import config
from src import data
from datetime import datetime
from src.data import Channel
def test_message_from():
conf = config.read_config(r'config.yaml')
data.compile_regex(conf)
text = '2021/03/08 23:24:52 17931875 bb3 [INFO Client 1492] @From NyhaiPuki: 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 = trader.parse_log(text)
@@ -23,6 +27,8 @@ def test_message_from():
def test_message_to():
conf = config.read_config(r'config.yaml')
data.compile_regex(conf)
text_to = '2021/01/24 23:11:23 17039703 bb2 [INFO Client 10144] @To EraseAndDelete: Thank you & good luck!'
message = trader.parse_log(text_to)
assert message.user == 'EraseAndDelete'
@@ -35,6 +41,8 @@ def test_message_to():
def test_message_global():
conf = config.read_config(r'config.yaml')
data.compile_regex(conf)
text_global = '2021/02/10 19:01:56 2720500 bb2 [INFO Client 3464] #HarvestScarab: so by the time it was finally juiced you couldnt do it'
message = trader.parse_log(text_global)
assert message.user == 'HarvestScarab'