aboutsummaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-11-06 09:50:44 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2025-11-06 09:55:33 +0100
commit08f50826ec76442d2a010bb23fda0ce66efad99d (patch)
tree69c7d00d41f51e068dae8d3b259816437e6614c9 /test.py
parent53be8ed80cf8b92e011b34ea8bf2e602adb8621e (diff)
downloadgeldschieberbot-08f50826ec76442d2a010bb23fda0ce66efad99d.tar.gz
geldschieberbot-08f50826ec76442d2a010bb23fda0ce66efad99d.zip
export the minimize command from the geldschieberbotminimize
Diffstat (limited to 'test.py')
-rwxr-xr-xtest.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/test.py b/test.py
index 602be6d..cd5b9bb 100755
--- a/test.py
+++ b/test.py
@@ -1437,5 +1437,33 @@ class TestStateLoadStore(unittest.TestCase):
self.assertTrue(compare_state(sp, state=bot.state))
+class TestMinimize(unittest.TestCase):
+ """Test the minimize command"""
+
+ def setUp(self):
+ reset_state("test/state_minimize.json")
+
+ def test_minimize(self):
+ res = run_bot(self, num[alice], "!minimize")
+ # The found cycle is not deterministic yet
+ # exp = "minimize:\nbob -> charlie -> alice 10"
+ # self.assertEqual( res.stdout, exp )
+ self.assertTrue("alice" in res.stdout)
+ self.assertTrue("bob" in res.stdout)
+ self.assertTrue("charlie" in res.stdout)
+ self.assertTrue("10" in res.stdout)
+
+ res = run_bot(self, num[alice], "!full-sum")
+ o =\
+"""Summary:
+alice:
+\tAll fine :)
+bob:
+\tAll fine :)
+charlie:
+\tAll fine :)"""
+ self.assertEqual(res.stdout, o)
+
+
if __name__ == '__main__':
unittest.main()