Exemplo n.º 1
0
    def setUp(self):
        rebuild_schema()
        self.session = HollowmanSession()

        self.account_dev = Account(id=4,
                                   name="Dev Team",
                                   namespace="dev",
                                   owner="company")
        self.account_infra = Account(name="Infra Team",
                                     namespace="infra",
                                     owner="company")

        self.user = User(tx_email="*****@*****.**", tx_name="John Doe")
        self.user.accounts = [self.account_dev, self.account_infra]

        self.user_with_one_account = User(
            tx_email="*****@*****.**",
            tx_name="User One Account")
        self.user_with_one_account.accounts = [self.account_dev]

        self.session.add(self.account_dev)
        self.session.add(self.account_infra)

        self.session.add(self.user)
        self.session.add(self.user_with_one_account)
        self.session.commit()
Exemplo n.º 2
0
 def setUp(self, single_full_app_fixture):
     rebuild_schema()
     self.session = HollowmanSession()
     self.user = User(tx_email="*****@*****.**", tx_name="John Doe", tx_authkey="69ed620926be4067a36402c3f7e9ddf0")
     self.account_dev = Account(id=4, name="Dev Team", namespace="dev", owner="company")
     self.user.accounts = [self.account_dev]
     self.session.add(self.user)
     self.session.add(self.account_dev)
     self.session.commit()
Exemplo n.º 3
0
    def setUp(self, single_full_app_fixture):

        self.request_apps = [
            (MarathonApp(id='/xablau'), MarathonApp(id='/xena')),
            (MarathonApp(id='/foo'), MarathonApp(id='/bar')),
        ]

        rebuild_schema()
        self.session = HollowmanSession()
        self.user = User(tx_email="*****@*****.**", tx_name="John Doe", tx_authkey="69ed620926be4067a36402c3f7e9ddf0")
        self.account_dev = Account(id=4, name="Dev Team", namespace="dev", owner="company")
        self.user.accounts = [self.account_dev]
        self.session.add(self.user)
        self.session.add(self.account_dev)
        self.session.commit()
Exemplo n.º 4
0
    def setUp(self):
        rebuild_schema()
        self.session = HollowmanSession()
        self.user = User(tx_email="*****@*****.**",
                         tx_name="John Doe",
                         tx_authkey="69ed620926be4067a36402c3f7e9ddf0")
        self.account_dev = Account(id=4,
                                   name="Dev Team",
                                   namespace="dev",
                                   owner="company")
        self.user.accounts = [self.account_dev]
        self.session.add(self.account_dev)
        self.session.add(self.user)
        self.session.commit()

        self.proxy_mock_patcher = patch.object(hollowman.routes, 'raw_proxy')
        self.proxy_mock = self.proxy_mock_patcher.start()
        self.proxy_mock.return_value = Response(status=200)
    def setUp(self, single_full_app_fixture):
        self.filter = AddOwnerConstraintFilter()
        rebuild_schema()
        self.session = HollowmanSession()
        self.user = User(tx_email="*****@*****.**",
                         tx_name="John Doe",
                         tx_authkey="69ed620926be4067a36402c3f7e9ddf0")
        self.account_dev = Account(id=4,
                                   name="Dev Team",
                                   namespace="dev",
                                   owner="company")
        self.user.accounts = [self.account_dev]
        self.session.add(self.user)
        self.session.add(self.account_dev)
        self.session.commit()

        self.request_app = SieveMarathonApp.from_json(single_full_app_fixture)
        self.original_app = SieveMarathonApp.from_json(single_full_app_fixture)
        self.user.current_account = self.account_dev
Exemplo n.º 6
0
    def setUp(self):
        rebuild_schema()
        self.session = HollowmanSession()

        self.new_dispatcher_user = User(
            tx_email="*****@*****.**",
            tx_name="Xablau",
            tx_authkey="69ed620926be4067a36402c3f7e9ddf0")
        self.normal_user = User(tx_email="*****@*****.**",
                                tx_name="John Doe",
                                tx_authkey="70ed620926be4067a36402c3f7e9ddf0")
        self.account = Account(name="New Account",
                               namespace="acc",
                               owner="company")
        self.normal_user.accounts = [self.account]
        self.session.add_all([self.new_dispatcher_user, self.normal_user])
        self.session.commit()

        self.response_http_200 = Response(status=200)
Exemplo n.º 7
0
 def setUp(self, fixture):
     rebuild_schema()
     self.session = HollowmanSession()
     self.user = User(tx_email="*****@*****.**",
                      tx_name="John Doe",
                      tx_authkey="69ed620926be4067a36402c3f7e9ddf0")
     self.account_dev = Account(id=4,
                                name="Dev Team",
                                namespace="dev",
                                owner="company")
     self.account_infra = Account(name="Infra Team",
                                  namespace="infra",
                                  owner="company")
     self.account_sup = Account(name="Support Team",
                                namespace="sup",
                                owner="company")
     self.user.accounts = [self.account_dev, self.account_infra]
     self.session.add(self.user)
     self.session.add(self.account_dev)
     self.session.add(self.account_infra)
     self.session.add(self.account_sup)
     self.user_with_no_accounts = User(
         tx_email="*****@*****.**",
         tx_name="No Accounts",
         tx_authkey="7b4184bfe7d2349eb56bcfb9dc246cf8")
     self.session.add(self.user_with_no_accounts)
     self.account_with_no_user = Account(name="Team Nobody",
                                         namespace="nobody",
                                         owner="nobody")
     self.session.add(self.account_with_no_user)
     self.session.commit()
     self.response_http_200 = MagicMock(status_code=200)
     responses.add(method='GET',
                   url=conf.MARATHON_ADDRESSES[0] + '/v2/apps',
                   body=json.dumps({'apps': [fixture]}),
                   status=200)
     responses.add(method='GET',
                   url=conf.MARATHON_ADDRESSES[0] + '/v2/apps//foo',
                   body=json.dumps({'app': fixture}),
                   status=200)
     responses.start()