aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtest.py50
-rw-r--r--test/state.json_3users1
-rw-r--r--test/state_2cars.json (renamed from test/state.json_2cars)2
-rw-r--r--test/state_3users.json (renamed from test/add_reg_state)2
-rw-r--r--test/state_transactions1.json (renamed from test/state.json_transactions1)0
5 files changed, 27 insertions, 28 deletions
diff --git a/test.py b/test.py
index 9126b1b..8d44c82 100755
--- a/test.py
+++ b/test.py
@@ -140,7 +140,7 @@ class TestRegCmd(unittest.TestCase):
res = run_bot(self, num[charlie], "!reg " + charlie)
self.assertEqual(res.stdout, 'Happy geldschiebing {}!'.format(charlie))
- self.assertTrue(compare_state("test/state.json_3users"))
+ self.assertTrue(compare_state("test/state_3users.json"))
class TestTransactionCmd(unittest.TestCase):
@@ -150,7 +150,7 @@ class TestTransactionCmd(unittest.TestCase):
reset_state()
def setUp(self):
- reset_state("test/state.json_3users")
+ reset_state("test/state_3users.json")
def test_correct_schieb(self):
res = run_bot(self, num[alice], "!schieb 10 " + bob)
@@ -239,7 +239,7 @@ class TestTransactionCmd(unittest.TestCase):
self.assertEqual(res.stdout,
'New Balance: {} -> 0.01 {}\n'.format(alice, bob))
- compare_state("test/state.json_transactions1")
+ compare_state("test/state_transactions1.json")
def test_transactions_with_myself(self):
res = run_bot(self, num[alice], f"!schieb {alice} 1,1")
@@ -256,7 +256,7 @@ class TestTransactionCmd(unittest.TestCase):
class TestSumCmd(unittest.TestCase):
def test_summary_single_user(self):
- reset_state("test/state.json_transactions1")
+ reset_state("test/state_transactions1.json")
res = run_bot(self, num[alice], "!sum " + alice)
self.assertEqual(
res.stdout,
@@ -269,7 +269,7 @@ class TestSumCmd(unittest.TestCase):
self.assertEqual(res.stdout, 'ERROR: name "alice" not registered')
def test_summary_double_user(self):
- reset_state("test/state.json_transactions1")
+ reset_state("test/state_transactions1.json")
res = run_bot(self, num[alice], "!sum {} {}".format(alice, bob))
summary = \
"""Summary:
@@ -285,7 +285,7 @@ bob:
self.assertEqual(res.stdout, summary)
def test_summary(self):
- reset_state("test/state.json_transactions1")
+ reset_state("test/state_transactions1.json")
res = run_bot(self, num[alice], "!sum")
self.assertEqual(
res.stdout,
@@ -293,7 +293,7 @@ bob:
)
def test_full_summary(self):
- reset_state("test/state.json_transactions1")
+ reset_state("test/state_transactions1.json")
res = run_bot(self, num[alice], "!full-sum")
summary = \
"""Summary:
@@ -312,7 +312,7 @@ charlie:
self.assertEqual(res.stdout, summary)
def test_full_summary_with_args(self):
- reset_state("test/state.json_transactions1")
+ reset_state("test/state_transactions1.json")
res = run_bot(self, num[alice], "!full-sum foo")
self.assertEqual(res.stdout, 'ERROR: full-sum takes no arguments')
@@ -333,7 +333,7 @@ class TestMisc(unittest.TestCase):
class TestListCmd(unittest.TestCase):
def setUp(self):
- reset_state("test/state.json_3users")
+ reset_state("test/state_3users.json")
def test_ls(self):
res = run_bot(self, num[alice], "!ls")
@@ -351,7 +351,7 @@ class TestListCmd(unittest.TestCase):
class TestSplitCmd(unittest.TestCase):
def setUp(self):
- reset_state("test/state.json_3users")
+ reset_state("test/state_3users.json")
def test_split_unregistered(self):
res = run_bot(self, "+4971576357", "!split")
@@ -435,7 +435,7 @@ alice:
class TestCarsAdd(unittest.TestCase):
def setUp(self):
- reset_state("test/state.json_3users")
+ reset_state("test/state_3users.json")
def test_add_success(self):
i = "!cars add foo 0.04"
@@ -448,7 +448,7 @@ class TestCarsAdd(unittest.TestCase):
o = 'added "bar" as an available car'
self.assertEqual(res.stdout, o)
- save_state("test/state.json_2cars")
+ save_state("test/state_2cars.json")
def test_add_invalid_service_charge(self):
i = "!cars add foo 0.04hut"
@@ -476,7 +476,7 @@ class TestCarsAdd(unittest.TestCase):
class TestCarsTransactions(unittest.TestCase):
def setUp(self):
- reset_state("test/state.json_2cars")
+ reset_state("test/state_2cars.json")
def test_schieb_car(self):
i = "!schieb foo 20"
@@ -488,7 +488,7 @@ class TestCarsTransactions(unittest.TestCase):
class TestCarsSum(unittest.TestCase):
def setUp(self):
- reset_state("test/state.json_2cars")
+ reset_state("test/state_2cars.json")
def test_sum_car(self):
res = run_bot(self, num[alice], "!sum foo")
@@ -503,7 +503,7 @@ foo:
class TestCarsRemove(unittest.TestCase):
def setUp(self):
- reset_state("test/state.json_2cars")
+ reset_state("test/state_2cars.json")
def test_schieb_car(self):
i = "!cars remove foo"
@@ -520,7 +520,7 @@ class TestCarsRemove(unittest.TestCase):
class TestCarPayCmd(unittest.TestCase):
def setUp(self):
- reset_state("test/state.json_2cars")
+ reset_state("test/state_2cars.json")
def test_alice_pays_exact(self):
run_bot(self, num[bob], "!zieh foo 20")
@@ -592,7 +592,7 @@ foo:
class TestCarsListCmd(unittest.TestCase):
def setUp(self):
- reset_state("test/state.json_2cars")
+ reset_state("test/state_2cars.json")
def test_no_cars(self):
reset_state()
@@ -655,7 +655,7 @@ foo:
class TestTankenCmd(unittest.TestCase):
def setUp(self):
- reset_state("test/state.json_3users")
+ reset_state("test/state_3users.json")
def test_tanken_3users(self):
i = \
@@ -754,7 +754,7 @@ Car foo:
class TestTransferCmd(unittest.TestCase):
def setUp(self):
- reset_state("test/state.json_3users")
+ reset_state("test/state_3users.json")
def test_transfer(self):
i = '!transfer 5 bob charlie'
@@ -795,7 +795,7 @@ New Balance: bob -> 5.00 charlie
class TestListChangesCmd(unittest.TestCase):
def setUp(self):
- reset_state("test/state.json_3users")
+ reset_state("test/state_3users.json")
def test_list_changes_unregistered(self):
res = run_bot(self, "+4971576357", "!list-changes")
@@ -875,7 +875,7 @@ Change 2:
class TestFuckCmd(unittest.TestCase):
def setUp(self):
- reset_state("test/state.json_3users")
+ reset_state("test/state_3users.json")
def test_fuck_unregistered(self):
res = run_bot(self, "+4971576357", "!fuck")
@@ -906,7 +906,7 @@ Rewinding:
alice <- 10.00 bob
"""
self.assertEqual(res.stdout, msg)
- compare_state("test/state.json_3users")
+ compare_state("test/state_3users.json")
def test_fuck_transfer(self):
run_bot(self, num[alice], f"!transfer 5 {bob} {charlie}")
@@ -920,7 +920,7 @@ alice <- 5.00 charlie
charlie <- 5.00 bob
"""
self.assertEqual(res.stdout, msg)
- compare_state("test/state.json_3users")
+ compare_state("test/state_3users.json")
def test_rewind_first(self):
run_bot(self, num[alice], f"!split 3 {bob} {charlie}")
@@ -960,13 +960,13 @@ alice <- 1.00 bob
alice <- 1.00 charlie
"""
self.assertEqual(res.stdout, msg)
- compare_state("test/state.json_3users")
+ compare_state("test/state_3users.json")
class TestScheduleCmd(unittest.TestCase):
def setUp(self):
- reset_state("test/state.json_3users")
+ reset_state("test/state_3users.json")
def test_weekly(self):
res = run_bot(self, num[alice], "!weekly stuff split 3 bob charlie")
diff --git a/test/state.json_3users b/test/state.json_3users
deleted file mode 100644
index 94b5a54..0000000
--- a/test/state.json_3users
+++ /dev/null
@@ -1 +0,0 @@
-{"balance": {"alice": {"bob": 0, "charlie": 0}, "bob": {"alice": 0, "charlie": 0}, "charlie": {"alice": 0, "bob": 0}}, "name2num": {"alice": "+49123456", "bob": "+49654321", "charlie": "+49615243"}, "num2name": {"+49123456": "alice", "+49654321": "bob", "+49615243": "charlie"}, "cars": {}, "scheduled_cmds": {}, "changes": {"alice": [], "bob": [], "charlie": []}} \ No newline at end of file
diff --git a/test/state.json_2cars b/test/state_2cars.json
index 05091a9..263ab6b 100644
--- a/test/state.json_2cars
+++ b/test/state_2cars.json
@@ -1 +1 @@
-{"balance": {"alice": {"bob": 0, "charlie": 0, "foo": 0, "bar": 0}, "bob": {"alice": 0, "charlie": 0, "foo": 0, "bar": 0}, "charlie": {"alice": 0, "bob": 0, "foo": 0, "bar": 0}, "foo": {"alice": 0, "bob": 0, "charlie": 0, "bar": 0}, "bar": {"alice": 0, "bob": 0, "charlie": 0, "foo": 0}}, "name2num": {"alice": "+49123456", "bob": "+49654321", "charlie": "+49615243"}, "num2name": {"+49123456": "alice", "+49654321": "bob", "+49615243": "charlie"}, "cars": {"foo": 4, "bar": 2}, "scheduled_cmds": {}, "changes": {"alice": [], "bob": [], "charlie": []}} \ No newline at end of file
+{"balance": {"alice": {"bob": 0, "charlie": 0, "foo": 0, "bar": 0}, "bob": {"alice": 0, "charlie": 0, "foo": 0, "bar": 0}, "charlie": {"alice": 0, "bob": 0, "foo": 0, "bar": 0}, "foo": {"alice": 0, "bob": 0, "charlie": 0, "bar": 0}, "bar": {"alice": 0, "bob": 0, "charlie": 0, "foo": 0}}, "name2num": {"alice": "+49123456", "bob": "+49654321", "charlie": "+49615243"}, "num2name": {"+49123456": "alice", "+49654321": "bob", "+49615243": "charlie"}, "cars": {"foo": 4, "bar": 2}, "scheduled_cmds": {}, "changes": {"alice": [], "bob": [], "charlie": []}, "aliases": {}} \ No newline at end of file
diff --git a/test/add_reg_state b/test/state_3users.json
index 94b5a54..7d4414a 100644
--- a/test/add_reg_state
+++ b/test/state_3users.json
@@ -1 +1 @@
-{"balance": {"alice": {"bob": 0, "charlie": 0}, "bob": {"alice": 0, "charlie": 0}, "charlie": {"alice": 0, "bob": 0}}, "name2num": {"alice": "+49123456", "bob": "+49654321", "charlie": "+49615243"}, "num2name": {"+49123456": "alice", "+49654321": "bob", "+49615243": "charlie"}, "cars": {}, "scheduled_cmds": {}, "changes": {"alice": [], "bob": [], "charlie": []}} \ No newline at end of file
+{"balance": {"alice": {"bob": 0, "charlie": 0}, "bob": {"alice": 0, "charlie": 0}, "charlie": {"alice": 0, "bob": 0}}, "name2num": {"alice": "+49123456", "bob": "+49654321", "charlie": "+49615243"}, "num2name": {"+49123456": "alice", "+49654321": "bob", "+49615243": "charlie"}, "cars": {}, "scheduled_cmds": {}, "changes": {"alice": [], "bob": [], "charlie": []}, "aliases": {}} \ No newline at end of file
diff --git a/test/state.json_transactions1 b/test/state_transactions1.json
index 990f5fe..990f5fe 100644
--- a/test/state.json_transactions1
+++ b/test/state_transactions1.json