From 2ad7fbc35c13093c3d13c796ea4fe4f03592d3db Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 25 Aug 2020 16:21:39 +0200 Subject: prohibit pure numerical names --- test.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test.py') diff --git a/test.py b/test.py index 929605c..56f6949 100755 --- a/test.py +++ b/test.py @@ -106,6 +106,13 @@ class TestRegCmd(unittest.TestCase): res = run_bot(self, num[alice], "!reg nase 03") self.assertEqual(res.stdout, 'ERROR: not in form "!reg name"') + def test_numerical_reg(self): + res = run_bot(self, num[alice], "!reg 9") + self.assertEqual(res.stdout, 'ERROR: pure numerical names are not allowed') + + res = run_bot(self, num[alice], "!reg 9.7") + self.assertEqual(res.stdout, 'ERROR: pure numerical names are not allowed') + def test_additional_reg(self): res = run_bot(self, num[alice], "!reg "+alice) self.assertEqual(res.stdout, 'Happy geldschiebing {}!'.format(alice)) @@ -317,6 +324,16 @@ alice: \t<- charlie 10.00 \tBalance: 10.00""" self.assertEqual(res.stdout, msg) + + def test_split_with_double_user(self): + res = run_bot(self, num[alice], f"!split 30 {charlie} {charlie}") + msg = \ +"""Split 30.00 between 3 -> 10.00 each +New Balance: +alice: +\t<- charlie 20.00 +\tBalance: 20.00""" + self.assertEqual(res.stdout, msg) def test_split(self): res = run_bot(self, num[alice], "!split 30 " + bob + " " + charlie) -- cgit v1.2.3