def test_cookie_dealer_improperly_configured(self):
        class BadServer():
            def __init__(self):
                self.symkey = ""

        with pytest.raises(ImproperlyConfigured) as err:
            CookieDealer(BadServer())
    def test_cookie_dealer_with_path(self):
        class DomServer():
            def __init__(self):
                self.symkey = b"0123456789012345"
                self.cookie_path = "/oidc"

        cookie_dealer = CookieDealer(DomServer())

        cookie_value = "Something to pass along"
        cookie_typ = "sso"
        cookie_name = "Foobar"

        kaka = cookie_dealer.create_cookie(cookie_value, cookie_typ,
                                           cookie_name)
        C = SimpleCookie()
        C.load(kaka[1])

        assert C[cookie_name]["path"] == "/oidc"
def cookie_dealer():
    class DummyServer():
        def __init__(self):
            self.symkey = b"0123456789012345"

    return CookieDealer(DummyServer())