diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2022-09-04 18:31:13 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2022-09-04 18:31:13 +0200 |
| commit | 39c256d308d200ffbce718b54d1b5a7f64680353 (patch) | |
| tree | ec12b6b7703508052bdc66d83c9c3b09191cbb52 | |
| parent | 60f70889c21a02397c8eaeee8db8da268b0b1ca5 (diff) | |
| download | geldschieberbot-39c256d308d200ffbce718b54d1b5a7f64680353.tar.gz geldschieberbot-39c256d308d200ffbce718b54d1b5a7f64680353.zip | |
add new sum alias 'balance'
| -rw-r--r-- | geldschieberbot.py | 1 | ||||
| -rwxr-xr-x | test.py | 12 |
2 files changed, 11 insertions, 2 deletions
diff --git a/geldschieberbot.py b/geldschieberbot.py index 4488114..43dfce4 100644 --- a/geldschieberbot.py +++ b/geldschieberbot.py @@ -988,6 +988,7 @@ class Geldschieberbot: 'alias': self.alias, 'sum': self.summary, 'summary': self.summary, + 'balance': self.summary, 'full-sum': self.full_summary, 'full-summary': self.full_summary, 'ls': self.list_users, @@ -310,9 +310,17 @@ bob: def test_summary(self): reset_state("test/state_transactions1.json") - res = run_bot(self, num[alice], "!sum") + self.assertEqual( - res.stdout, + run_bot(self, num[alice], "!sum").stdout, + 'Summary:\nalice:\n\t-> bob 0.01\n\t-> charlie 1.00\n\tBalance: -1.01' + ) + self.assertEqual( + run_bot(self, num[alice], "!summary").stdout, + 'Summary:\nalice:\n\t-> bob 0.01\n\t-> charlie 1.00\n\tBalance: -1.01' + ) + self.assertEqual( + run_bot(self, num[alice], "!balance").stdout, 'Summary:\nalice:\n\t-> bob 0.01\n\t-> charlie 1.00\n\tBalance: -1.01' ) |
