class TestContext: def setup_method(self, method): self.context = Context() def test_claim_for(self): assert self.context.owner == None self.context.claim_for('foobar') assert self.context.owner == 'foobar' def test_release(self): self.context.claim_for('barfoo') assert self.context.owner == 'barfoo' self.context.release() assert self.context.owner == None
def setup_method(self, method): self.context = Context()