aboutsummaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'test.py')
-rwxr-xr-xtest.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/test.py b/test.py
index 94235e1..929605c 100755
--- a/test.py
+++ b/test.py
@@ -197,6 +197,13 @@ class TestTransactionCmd(unittest.TestCase):
compare_state("test/state.json_transactions1")
+ def test_transactions_with_myself(self):
+ res = run_bot(self, num[alice], f"!schieb {alice} 1,1")
+ self.assertEqual(res.stdout, 'ERROR: you can not transfere money to or from yourself')
+
+ res = run_bot(self, num[alice], f"!zieh {alice} 2.1")
+ self.assertEqual(res.stdout, 'ERROR: you can not transfere money to or from yourself')
+
class TestSumCmd(unittest.TestCase):
def test_summary_single_user(self):
reset_state("test/state.json_transactions1")
@@ -299,6 +306,17 @@ alice:
\t<- charlie 10.00
\tBalance: 10.00"""
self.assertEqual(res.stdout, msg)
+
+ def test_split_with_sender_in_user_list(self):
+ res = run_bot(self, num[alice], f"!split 30 {charlie} {alice}")
+ msg = \
+"""Split 30.00 between 3 -> 10.00 each
+alice, you will be charged multiple times. This may not be what you want
+New Balance:
+alice:
+\t<- charlie 10.00
+\tBalance: 10.00"""
+ self.assertEqual(res.stdout, msg)
def test_split(self):
res = run_bot(self, num[alice], "!split 30 " + bob + " " + charlie)