diff --git a/config.yaml b/config.yaml index 649985a..518be07 100644 --- a/config.yaml +++ b/config.yaml @@ -12,4 +12,4 @@ Chat: sold: 'Sorry, {item} is already sold' Parser: re_log: '(?P\d\d\d\d/\d\d/\d\d \d\d:\d\d:\d\d) (\d+) (\S+) \[(?P\S+) (\S+) (\d+)\] (?P[#@%$&]?)(?PTo|From)?\s?(?P<\S+>)? ?(?P[^:]+): (?P.*)' - re_trade: 'Hi, I would like to buy your ?(?P\d*) (?P.+) (listed )?for (my )?(?P\d+) (?P\D+) in (?P\w+)\.?( \(stash tab "(?P.+)"; position: left (?P\d+), top (?P\d+)\))?' + re_trade: 'Hi, I(( would)|(''d)) like to buy your ?(?P\d*) (?P.+) (listed )?for (my )?(?P\d+) (?P\D+) in (?P\w+)\.?( \(stash tab "(?P.+)"; position: left (?P\d+), top (?P\d+)\))?' diff --git a/tests/test_log.py b/tests/test_log.py index 5ce0f5d..c73989b 100644 --- a/tests/test_log.py +++ b/tests/test_log.py @@ -18,3 +18,12 @@ def test_write_to_log_2(): 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 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)