aboutsummaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2022-07-06 10:17:57 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2022-07-06 10:18:39 +0200
commit59b3609e4904910bb2d1be6a95c748b07b777211 (patch)
tree2cd4caab1b86a1984d0ffcb7652d3122c9d0edf3 /test.py
parent2fe86be4e3b999ec4941284274b586dd0f2fecb7 (diff)
downloadgeldschieberbot-59b3609e4904910bb2d1be6a95c748b07b777211.tar.gz
geldschieberbot-59b3609e4904910bb2d1be6a95c748b07b777211.zip
support aliases in tanken command
Move tanken code into Gelschieberbot to simply expand aliases in drives.
Diffstat (limited to 'test.py')
-rwxr-xr-xtest.py24
1 files changed, 24 insertions, 0 deletions
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):