From 3199c11a7b92e2ce2739fe6a167a09fb401e62aa Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Thu, 25 Mar 2021 12:42:01 +0100 Subject: support !split person amount --- test.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'test.py') 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 = \ -- cgit v1.2.3