From a1636f8f709d283e1ae4a8d3200e1cf2f7923a42 Mon Sep 17 00:00:00 2001 From: Oliver Hartmann Date: Sat, 20 Mar 2021 21:31:38 +0100 Subject: [PATCH] Added test for writing the log --- tests/test_log.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/test_log.py diff --git a/tests/test_log.py b/tests/test_log.py new file mode 100644 index 0000000..d21246e --- /dev/null +++ b/tests/test_log.py @@ -0,0 +1,10 @@ +from src import config + + +def test_write_to_log(): + conf = config.read_config(r'config.yaml') + log_file = conf['General']['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)