# HG changeset patch # User Sebastien Jodogne # Date 1726082448 -7200 # Node ID b58f639aee60f9ca6a1f8c0f1b99c88ee3bb84b6 # Parent edf6ce075823b4c5bc946f3c3aab6f5acb88ac06 added tests for limit=0 diff -r edf6ce075823 -r b58f639aee60 Tests/Tests.py --- a/Tests/Tests.py Tue Sep 10 14:33:04 2024 +0200 +++ b/Tests/Tests.py Wed Sep 11 21:20:48 2024 +0200 @@ -3007,8 +3007,16 @@ self.assertRaises(Exception, lambda: DoGet(_REMOTE, '/patients&since=10' % i)) self.assertRaises(Exception, lambda: DoGet(_REMOTE, '/patients&limit=10' % i)) - if not IsOrthancVersionAbove(_REMOTE, 1, 12, 5): # with ExtendedFind, the limit=0 means no-limit like in /tools/find + if IsOrthancVersionAbove(_REMOTE, 1, 12, 5): # with ExtendedFind, the limit=0 means no-limit like in /tools/find + self.assertEqual(2, len(DoGet(_REMOTE, '/patients?since=0&limit=0'))) + self.assertEqual(1, len(DoGet(_REMOTE, '/patients?since=1&limit=0'))) + self.assertEqual(0, len(DoGet(_REMOTE, '/patients?since=2&limit=0'))) + self.assertEqual(0, len(DoGet(_REMOTE, '/patients?since=3&limit=0'))) + else: self.assertEqual(0, len(DoGet(_REMOTE, '/patients?since=0&limit=0'))) + self.assertEqual(0, len(DoGet(_REMOTE, '/patients?since=1&limit=0'))) + self.assertEqual(0, len(DoGet(_REMOTE, '/patients?since=2&limit=0'))) + self.assertEqual(0, len(DoGet(_REMOTE, '/patients?since=3&limit=0'))) self.assertEqual(2, len(DoGet(_REMOTE, '/patients?since=0&limit=100'))) self.assertEqual(2, len(DoGet(_REMOTE, '/studies?since=0&limit=100'))) self.assertEqual(4, len(DoGet(_REMOTE, '/series?since=0&limit=100')))