Fix vault linting errors

This commit is contained in:
Nuwan Goonasekera
2021-11-22 01:21:00 +05:30
parent e6494b16ce
commit 0572f62075
4 changed files with 8 additions and 7 deletions
+2 -2
View File
@@ -1,9 +1,9 @@
from abc import ABC
import json
import logging
import os
import yaml
from abc import ABC
import yaml
from cryptography.fernet import Fernet, MultiFernet
try:
+1 -2
View File
@@ -2,14 +2,13 @@ import json
import os
from requests import (
delete,
get,
put
)
from ._framework import ApiTestCase
TEST_USER_EMAIL = "user_for_users_index_test@bx.psu.edu"
TEST_USER_EMAIL = "vault_test_user@bx.psu.edu"
class VaultApiTestCase(ApiTestCase):
+1
View File
@@ -28,6 +28,7 @@ JOB_CONF_YAML = """
runners:
runner1:
load: job_runner_A
"""
VAULT_CONF_CUSTOS = """
type: custos
"""
+4 -3
View File
@@ -1,8 +1,10 @@
from abc import ABC
import os
import string
import tempfile
import unittest
from abc import ABC
from cryptography.fernet import InvalidToken
from galaxy.app_unittest_utils.galaxy_mock import MockApp, MockAppConfig
from galaxy.security import vault
@@ -53,7 +55,6 @@ class TestDatabaseVault(VaultTestBase, unittest.TestCase):
app.config.vault_config_file = VAULT_CONF_DATABASE_ROTATED
self.vault = vault.VaultFactory.from_app(app)
self.assertEqual(self.vault.read_secret("my/rotated/secret"), "hello rotated")
super().test_read_write_secret()
def test_wrong_keys(self):
config = MockAppConfig(vault_config_file=VAULT_CONF_DATABASE)
@@ -64,7 +65,7 @@ class TestDatabaseVault(VaultTestBase, unittest.TestCase):
# should fail because decryption keys are the wrong
app.config.vault_config_file = VAULT_CONF_DATABASE_INVALID
self.vault = vault.VaultFactory.from_app(app)
with self.assertRaises(Exception):
with self.assertRaises(InvalidToken):
self.vault.read_secret("my/incorrect/secret")