From 08f50826ec76442d2a010bb23fda0ce66efad99d Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Thu, 6 Nov 2025 09:50:44 +0100 Subject: export the minimize command from the geldschieberbot --- test.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'test.py') 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() -- cgit v1.2.3