Exemplo n.º 1
0
class TestOrganizationFactory(unittest.TestCase):

    def setUp(self):
        self._factory = OrganizationFactory(uuid1(), ANY, transport=MagicMock())

    def test_make_directory_client(self):
        self.assertIsInstance(self._factory.make_directory_client(uuid1()), DirectoryClient)

    def test_make_organization_client(self):
        self.assertIsInstance(self._factory.make_organization_client(), OrganizationClient)

    def test_make_service_client(self):
        self.assertIsInstance(self._factory.make_service_client(uuid1()), ServiceClient)
Exemplo n.º 2
0
class TestOrganizationFactory(unittest.TestCase):
    def setUp(self):
        self._factory = OrganizationFactory(uuid1(),
                                            ANY,
                                            transport=MagicMock())

    def test_make_directory_client(self):
        self.assertIsInstance(self._factory.make_directory_client(uuid1()),
                              DirectoryClient)

    def test_make_organization_client(self):
        self.assertIsInstance(self._factory.make_organization_client(),
                              OrganizationClient)

    def test_make_service_client(self):
        self.assertIsInstance(self._factory.make_service_client(uuid1()),
                              ServiceClient)
    def __init__(self, organization_id, organization_key, directory_id,
                 service_id, launchkey_url, use_advanced_webhooks):
        self.organization_id = organization_id
        self.directory_id = directory_id
        self.service_id = service_id

        organization_factory = OrganizationFactory(organization_id,
                                                   organization_key,
                                                   url=launchkey_url)
        self.organization_client = organization_factory.\
            make_organization_client()
        self.directory_client = organization_factory.make_directory_client(
            directory_id)
        self.service_client = organization_factory.make_service_client(
            service_id)

        self.use_advanced_webhooks = use_advanced_webhooks
Exemplo n.º 4
0
bootstrap = Bootstrap(app)
app.debug = True
app.config['SECRET_KEY'] = "Welcometolaunchkey"
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite://///Users/ianhinden/Documents/Programming/LaunchKeyTest/LaunchKeyTest/database.db'
db = SQLAlchemy(app)

organization_id = "9eb44784-ffb6-11e7-beac-32c85991b6e3"
organization_private_key = open('organization_private_key.key').read()
directory_id = "8d8bc0e2-015d-11e8-9daa-16cd5ddd3780"
service_id = "df4d2d1a-ffb6-11e7-a5f3-4697f50c1dd9"
service_private_key = open('service_private_key.key').read()

service_factory = ServiceFactory(service_id, service_private_key)
organization_factory = OrganizationFactory(organization_id, organization_private_key)
directory_client = organization_factory.make_directory_client(directory_id)
service_client = organization_factory.make_service_client(service_id)

class User(db.Model):
	id = db.Column(db.Integer, primary_key=True)
	username = db.Column(db.String(), unique=True)
	email = db.Column(db.String(), unique=True)
	password = db.Column(db.String())
	phone = db.Column(db.String(), unique=True)


class LoginForm(FlaskForm):
	username = StringField("username", validators=[InputRequired(), Length(min=4, max=15)])
	#password = PasswordField("password", validators=[InputRequired(), Length(min=8)])
	submit = SubmitField('Sign In')

@app.route("/", methods=['GET', 'POST'])