# Path: tokenserver/verifiers.py
# DEFAULT_OAUTH_SCOPE = 'https://identity.mozilla.com/apps/oldsync'


import os
import json
import time
import uuid
import random
import urlparse
import browserid
import browserid.jwt
from browserid.tests.support import make_assertion
from tokenserver.verifiers import DEFAULT_OAUTH_SCOPE
from loads import TestCase

    server_url = 'https://token.stage.mozaws.net'

    def setUp(self):
        self.endpoint = urlparse.urljoin(self.server_url, '/1.0/sync/1.5')
        self.audience = self.server_url.rstrip('/')

    def test_server_config(self):
        """Sanity-check server config against local settings.

        This is a quick test that fetches config from the target server
        and checks it against our local settings.  It will fail if there's
        a mis-match that would cause our loatests to fail.
        """
        res = self.session.get(self.server_url + '/')
        self.assertEquals(res.status_code, 200)
        server_config = res.json()
        try:
            allowed_issuers = server_config['browserid']['allowed_issuers']
            if allowed_issuers is not None:
                if MOCKMYID_DOMAIN not in allowed_issuers:
                    msg = 'Server does not allow browserid assertions from {}'
                    raise AssertionError(msg.format(MOCKMYID_DOMAIN))
        except KeyError:
            pass
        if server_config['oauth']['default_issuer'] != MOCKMYID_DOMAIN:
            msg = 'OAuth default_issuer does not match {}'
            raise AssertionError(msg.format(MOCKMYID_DOMAIN))
        if server_config['oauth']['scope'] != DEFAULT_OAUTH_SCOPE:
            msg = 'OAuth scope does not match {}'

# Path: tokenserver/verifiers.py
# DEFAULT_OAUTH_SCOPE = 'https://identity.mozilla.com/apps/oldsync'


# Path: loadtest/loadtest.py
import os
import json
import time
import uuid
import random
import urlparse
import browserid
import browserid.jwt
from browserid.tests.support import make_assertion
from tokenserver.verifiers import DEFAULT_OAUTH_SCOPE
from loads import TestCase


    server_url = 'https://token.stage.mozaws.net'

    def setUp(self):
        self.endpoint = urlparse.urljoin(self.server_url, '/1.0/sync/1.5')
        self.audience = self.server_url.rstrip('/')

    def test_server_config(self):
        """Sanity-check server config against local settings.

        This is a quick test that fetches config from the target server
        and checks it against our local settings.  It will fail if there's
        a mis-match that would cause our loatests to fail.
        """
        res = self.session.get(self.server_url + '/')
        self.assertEquals(res.status_code, 200)
        server_config = res.json()
        try:
            allowed_issuers = server_config['browserid']['allowed_issuers']
            if allowed_issuers is not None:
                if MOCKMYID_DOMAIN not in allowed_issuers:
                    msg = 'Server does not allow browserid assertions from {}'
                    raise AssertionError(msg.format(MOCKMYID_DOMAIN))
        except KeyError:
            pass
        if server_config['oauth']['default_issuer'] != MOCKMYID_DOMAIN:
            msg = 'OAuth default_issuer does not match {}'
            raise AssertionError(msg.format(MOCKMYID_DOMAIN))
        if server_config['oauth']['scope'] != DEFAULT_OAUTH_SCOPE:
            msg = 'OAuth scope does not match {}'

            raise AssertionError(msg.format(DEFAULT_OAUTH_SCOPE))