コード例 #1
0
 def test_enable_all_accounts(self):
     bulk_enable_accounts([
         'TEST_ACCOUNT1', 'TEST_ACCOUNT2', 'TEST_ACCOUNT3', 'TEST_ACCOUNT4'
     ])
     accounts = Account.query.all()
     for account in accounts:
         self.assertTrue(account.active)
コード例 #2
0
 def test_enable_bad_accounts(self):
     bulk_enable_accounts(['BAD_ACCOUNT'])
     accounts = Account.query.all()
     for account in accounts:
         if account.name == 'TEST_ACCOUNT1' or account.name == 'TEST_ACCOUNT2':
             self.assertTrue(account.active)
         else:
             self.assertFalse(account.active)
コード例 #3
0
 def test_enable_one_accounts(self):
     bulk_enable_accounts(['TEST_ACCOUNT3'])
     accounts = Account.query.all()
     for account in accounts:
         if account.name != 'TEST_ACCOUNT4':
             self.assertTrue(account.active)
         else:
             self.assertFalse(account.active)
コード例 #4
0
ファイル: manage.py プロジェクト: Netflix/security_monkey
def enable_accounts(accounts):
    """ Bulk enables one or more accounts """
    try:
        account_names = _parse_accounts(accounts)
    except KeyError as e:
        app.logger.error("The passed in account: {} does not exist in Security Monkey's database.".format(e.message))
        return -1

    bulk_enable_accounts(account_names)
コード例 #5
0
def enable_accounts(accounts):
    """ Bulk enables one or more accounts """
    try:
        account_names = _parse_accounts(accounts)
    except KeyError as e:
        app.logger.error("The passed in account: {} does not exist in Security Monkey's database.".format(e.message))
        return -1

    bulk_enable_accounts(account_names)