Esempio n. 1
0
    def test_empty(self):
        self.assert_is_none(local.pop())

        with self.assert_raises(ayame.AyameError):
            local.context()
        with self.assert_raises(ayame.AyameError):
            local.app()
Esempio n. 2
0
    def test_empty(self):
        self.assert_is_none(local.pop())

        with self.assert_raises(ayame.AyameError):
            local.context()
        with self.assert_raises(ayame.AyameError):
            local.app()
Esempio n. 3
0
    def test_push(self):
        ctx = local.push(0, 1)
        self.assert_equal(ctx.app, 0)
        self.assert_equal(ctx.environ, 1)
        self.assert_is_none(ctx.request)
        self.assert_is_none(ctx._router)

        self.assert_is(local.context(), ctx)
        self.assert_is(local.app(), ctx.app)
        self.assert_is(local.pop(), ctx)

        self.assert_is_none(local.pop())

        with self.assert_raises(ayame.AyameError):
            local.context()
        with self.assert_raises(ayame.AyameError):
            local.app()
Esempio n. 4
0
    def test_push(self):
        ctx = local.push(0, 1)
        self.assert_equal(ctx.app, 0)
        self.assert_equal(ctx.environ, 1)
        self.assert_is_none(ctx.request)
        self.assert_is_none(ctx._router)

        self.assert_is(local.context(), ctx)
        self.assert_is(local.app(), ctx.app)
        self.assert_is(local.pop(), ctx)

        self.assert_is_none(local.pop())

        with self.assert_raises(ayame.AyameError):
            local.context()
        with self.assert_raises(ayame.AyameError):
            local.app()