MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_modify

Method test_modify

test/base/test_utils.py:272–297  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

270 eq_(str(o), "OrderedSet([3, 2, 4, 5])")
271
272 def test_modify(self):
273 o = util.OrderedSet([3, 9, 11])
274 is_none(o.add(42))
275 in_(42, o)
276 in_(3, o)
277
278 is_none(o.remove(9))
279 not_in(9, o)
280 in_(3, o)
281
282 is_none(o.discard(11))
283 in_(3, o)
284
285 o.add(99)
286 is_none(o.insert(1, 13))
287 eq_(list(o), [3, 13, 42, 99])
288 eq_(o[2], 42)
289
290 val = o.pop()
291 eq_(val, 99)
292 not_in(99, o)
293 eq_(list(o), [3, 13, 42])
294
295 is_none(o.clear())
296 not_in(3, o)
297 is_false(bool(o))
298
299 def test_empty_pop(self):
300 with expect_raises_message(KeyError, "pop from an empty set"):

Callers

nothing calls this directly

Calls 11

addMethod · 0.95
removeMethod · 0.95
discardMethod · 0.95
insertMethod · 0.95
popMethod · 0.95
clearMethod · 0.95
is_noneFunction · 0.90
in_Function · 0.90
not_inFunction · 0.90
eq_Function · 0.90
is_falseFunction · 0.90

Tested by

no test coverage detected