aboutsummaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'test.py')
-rwxr-xr-xtest.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/test.py b/test.py
index e786a93..023b369 100755
--- a/test.py
+++ b/test.py
@@ -299,10 +299,6 @@ class TestSplitCmd(unittest.TestCase):
res = run_bot(self, num[alice], "!split 10")
self.assertEqual(res.stdout, 'ERROR: not in form "!split amount [name]+"')
- res = run_bot(self, num[alice], "!split foo 10")
- self.assertEqual(res.stdout, 'ERROR: amount must be a positive number')
-
-
def test_split_one_unknown_user(self):
res = run_bot(self, num[alice], "!split 30 " + "foo" + " " + charlie)
msg = \
@@ -346,6 +342,16 @@ alice:
\tBalance: 20.00"""
self.assertEqual(res.stdout, msg)
+ def test_split_single_user_amount_swap(self):
+ res = run_bot(self, num[alice], f"!split {bob} 10")
+ msg = \
+"""Split 10.00 between 2 -> 5.00 each
+New Balance:
+alice:
+\t<- bob 5.00
+\tBalance: 5.00"""
+ self.assertEqual(res.stdout, msg)
+
def test_split_whitespace(self):
res = run_bot(self, num[alice], "!split 30 " + bob + " " + charlie + " ")
msg = \