> On Jan. 16, 2014, 10:47 a.m., opticron wrote: > > /asterisk/trunk/tests/rest_api/mailbox/baseline/mailbox_baseline.py, lines > > 38-55 > > <https://reviewboard.asterisk.org/r/3118/diff/2/?file=51376#file51376line38> > > > > This could be simplified to: > > expected = [ > > {"name": "alice_mailbox", "old_messages": 3, "new_messages": 4}, > > {"name": "bob_mailbox", "old_messages": 5, "new_messages": 6} > > ] > > assert set(mailboxes) == set(expected)
set() can't actually be used on a list of dictionaries for whatever reason. But straight up comparison works fine if the lists are sorted ahead of time. I had to include operator in order to sort the list of dictionaries by the name key though. - Jonathan ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviewboard.asterisk.org/r/3118/#review10601 ----------------------------------------------------------- On Jan. 9, 2014, 5:40 p.m., Jonathan Rose wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviewboard.asterisk.org/r/3118/ > ----------------------------------------------------------- > > (Updated Jan. 9, 2014, 5:40 p.m.) > > > Review request for Asterisk Developers, Kevin Harwell, Matt Jordan, and Mark > Michelson. > > > Repository: testsuite > > > Description > ------- > > Somewhat similar to kharwell's device state tests. > > ARI is used to: > * create a couple mailboxes > * confirm that GET can be used to get one mailbox and that it matches > expectations > * confirm that GET can be used to get all the mailboxes and that they match > expectations > * modify one mailbox > * delete another mailbox > * verify that the mailbox that was deleted is no longer obtained by get > * verify that the mailbox that was modified has the modified state. > > The nature of these operations is simple enough that this seemed appropriate > to be a single test. > > > Diffs > ----- > > /asterisk/trunk/tests/rest_api/tests.yaml 4545 > /asterisk/trunk/tests/rest_api/mailbox/baseline/test-config.yaml > PRE-CREATION > /asterisk/trunk/tests/rest_api/mailbox/baseline/mailbox_baseline.py > PRE-CREATION > > /asterisk/trunk/tests/rest_api/mailbox/baseline/configs/ast1/extensions.conf > PRE-CREATION > > Diff: https://reviewboard.asterisk.org/r/3118/diff/ > > > Testing > ------- > > Ran the test. Varied the expectations from the results to cause failures for > each substep. > > > Thanks, > > Jonathan Rose > >
-- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev