diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2021-03-25 12:42:01 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2021-03-25 12:42:01 +0100 |
| commit | 3199c11a7b92e2ce2739fe6a167a09fb401e62aa (patch) | |
| tree | 44b0e41d131d54514d886563985f342cf90451cd /test.py | |
| parent | e9f15a794b62fa8d18e926dfd2fe52fcef180c56 (diff) | |
| download | geldschieberbot-3199c11a7b92e2ce2739fe6a167a09fb401e62aa.tar.gz geldschieberbot-3199c11a7b92e2ce2739fe6a167a09fb401e62aa.zip | |
support !split person amount
Diffstat (limited to 'test.py')
| -rwxr-xr-x | test.py | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -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 = \ |
