예제 #1
0
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
예제 #2
0
 def setup_method(self, method):
     self.context = Context()