MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_popitem

Method test_popitem

test/ext/test_mutable.py:399–417  ·  test/ext/test_mutable.py::_MutableDictTestBase.test_popitem
(self)

Source from the content-addressed store, hash-verified

397 eq_(f1.data, {class="st">"c": class="st">"d"})
398
399 def test_popitem(self):
400 sess = fixture_session()
401
402 orig = {class="st">"a": class="st">"b", class="st">"c": class="st">"d"}
403
404 class="cm"># the orig dict remains unchanged when we assign,
405 class="cm"># but just making this future-proof
406 data = dict(orig)
407 f1 = Foo(data=data)
408 sess.add(f1)
409 sess.commit()
410
411 k, v = f1.data.popitem()
412 assert k in (class="st">"a", class="st">"c")
413 orig.pop(k)
414
415 sess.commit()
416
417 eq_(f1.data, orig)
418
419 def test_setdefault(self):
420 sess = fixture_session()

Callers

nothing calls this directly

Calls 7

fixture_sessionFunction · 0.90
eq_Function · 0.90
FooClass · 0.70
addMethod · 0.45
commitMethod · 0.45
popitemMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected