From 59b3609e4904910bb2d1be6a95c748b07b777211 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 6 Jul 2022 10:17:57 +0200 Subject: support aliases in tanken command Move tanken code into Gelschieberbot to simply expand aliases in drives. --- test.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'test.py') diff --git a/test.py b/test.py index d279e0b..e839536 100755 --- a/test.py +++ b/test.py @@ -514,6 +514,30 @@ charlie: \t<- bob 3.00 \tBalance: 6.00""") + def test_tanken_all(self): + res = run_bot(self, num[alice], "!tanken 10\n10 all") + self.assertEqual(res.stdout, \ +"""alice: 10km = fuel: 3.33, service charge: 0.00 +bob: 10km = fuel: 3.33, service charge: 0.00 +charlie: 10km = fuel: 3.33, service charge: 0.00 +New Balance: +alice: +\t<- bob 3.33 +\t<- charlie 3.33 +\tBalance: 6.66""") + + def test_tanken_alias(self): + run_bot(self, num[alice], f"!alias alob {alice} {bob}") + res = run_bot(self, num[charlie], "!tanken 8\n10 alob") + self.assertEqual(res.stdout, \ +"""alice: 10km = fuel: 4.00, service charge: 0.00 +bob: 10km = fuel: 4.00, service charge: 0.00 +New Balance: +charlie: +\t<- alice 4.00 +\t<- bob 4.00 +\tBalance: 8.00""") + class TestCarsAdd(unittest.TestCase): -- cgit v1.2.3