39 lines
1.6 KiB
Python
39 lines
1.6 KiB
Python
from src import config
|
|
|
|
|
|
def test_write_to_log():
|
|
config.read_config(r'config.yaml')
|
|
log_file = config.get_value('General.log_file')
|
|
assert (log_file)
|
|
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)'
|
|
with open(log_file, 'a') as f:
|
|
f.write(text)
|
|
|
|
|
|
def test_write_to_log_2():
|
|
config.read_config(r'config.yaml')
|
|
log_file = config.get_value('General.log_file')
|
|
assert (log_file)
|
|
text = ' 2021/05/09 15:25:21 14716218 bad [INFO Client 15632] @From iveseee: Hi, I would like to buy your 2 Ancient Orb for my 28 Chaos Orb in Ultimatum.'
|
|
with open(log_file, 'a') as f:
|
|
f.write(text)
|
|
|
|
|
|
def test_write_to_log_3():
|
|
config.read_config(r'config.yaml')
|
|
log_file = config.get_value('General.log_file')
|
|
assert (log_file)
|
|
text = "2021/05/09 17:18:05 21480531 bad [INFO Client 15632] @From <ABC> DYNVMIT: Hi, I'd like to buy your 42 Simulacrum Splinter for my 28 Chaos Orb in Ultimatum."
|
|
with open(log_file, 'a') as f:
|
|
f.write(text)
|
|
|
|
|
|
def test_write_to_log_4():
|
|
config.read_config(r'config.yaml')
|
|
log_file = config.get_value('General.log_file')
|
|
assert (log_file)
|
|
text = "2021/05/11 23:34:41 13600796 bad [INFO Client 9008] @From <CHIP> HerculadeDrik: Hi, I would like to buy your Cortex Relic Chambers Map (T15) listed for 3.4 exalted in Ultimatum (stash tab \"$\"; position: left 3, top 9)"
|
|
with open(log_file, 'a') as f:
|
|
f.write(text)
|