|
15 | 15 | # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
16 | 16 | # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
17 | 17 | # |
18 | | -# $Id: db_test_base.py,v 1.86 2007-08-29 16:40:20 jpend Exp $ |
| 18 | +# $Id: db_test_base.py,v 1.87 2007-08-29 17:35:41 jpend Exp $ |
19 | 19 |
|
20 | 20 | import unittest, os, shutil, errno, imp, sys, time, pprint, sets |
21 | 21 |
|
@@ -263,15 +263,20 @@ def testMultilinkChangeIterable(self): |
263 | 263 | nosy=1) |
264 | 264 | u1 = self.db.user.create(username='foo%s'%commit) |
265 | 265 | u2 = self.db.user.create(username='bar%s'%commit) |
266 | | - nid = self.db.issue.create(title="spam", nosy=set(u1)) # set |
| 266 | + # try a couple of the built-in iterable types to make |
| 267 | + # sure that we accept them and handle them properly |
| 268 | + # try a set as input for the multilink |
| 269 | + nid = self.db.issue.create(title="spam", nosy=set(u1)) |
267 | 270 | if commit: self.db.commit() |
268 | 271 | self.assertEqual(self.db.issue.get(nid, "nosy"), [u1]) |
269 | 272 | self.assertRaises(TypeError, self.db.issue.set, nid, |
270 | 273 | nosy='invalid type') |
271 | | - self.db.issue.set(nid, nosy=tuple()) # tuple |
| 274 | + # test with a tuple |
| 275 | + self.db.issue.set(nid, nosy=tuple()) |
272 | 276 | if commit: self.db.commit() |
273 | 277 | self.assertEqual(self.db.issue.get(nid, "nosy"), []) |
274 | | - self.db.issue.set(nid, nosy=frozenset([u1,u2])) # frozenset |
| 278 | + # make sure we accept a frozen set |
| 279 | + self.db.issue.set(nid, nosy=frozenset([u1,u2])) |
275 | 280 | if commit: self.db.commit() |
276 | 281 | l = [u1,u2]; l.sort() |
277 | 282 | m = self.db.issue.get(nid, "nosy"); m.sort() |
|
0 commit comments