Skip to content

Commit

Permalink
reformat test files with black and satisfy flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
cognifloyd committed Jan 28, 2021
1 parent a7771f6 commit e8a95e7
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 16 deletions.
1 change: 1 addition & 0 deletions tests/test_action_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def test_delete_existing_key(self):
action = self.get_action_instance(config=self.dummy_pack_config)
action_result = action.run(path="secret/stanley")
# action_result is a requests.response object
assert action_result is not None

result = self.client.read("secret/stanley")
assert result is None
2 changes: 1 addition & 1 deletion tests/test_action_get_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class GetPolicyActionTestCase(VaultActionTestCase):

def test_method(self):
# setup
rules_text, rules_obj = self.prep_policy("stanley")
rules_text, _ = self.prep_policy("stanley")

# test
action = self.get_action_instance(config=self.dummy_pack_config)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_action_list_policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class PolicyListActionTestCase(VaultActionTestCase):

def test_method(self):
# setup
rules_text, rules_obj = self.prep_policy("stanley")
self.prep_policy("stanley")

# test
action = self.get_action_instance(config=self.dummy_pack_config)
Expand Down
1 change: 0 additions & 1 deletion tests/test_action_read_kv.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def test_read_kv1(self):
mount_point=mount_point,
)


# test
action = self.get_action_instance(config=self.dummy_pack_config)
result = action.run(
Expand Down
9 changes: 1 addition & 8 deletions tests/test_action_set_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,7 @@ def test_method(self):
path "sys" { policy = "deny" }
path "secret" { policy = "write" }
"""
rules_obj = {
"path": {
"sys": {
"policy": "deny"},
"secret": {
"policy": "write"}
}
}
# rules_obj = {"path": {"sys": {"policy": "deny"}, "secret": {"policy": "write"}}}

action = self.get_action_instance(config=self.dummy_pack_config)
action_result = action.run(
Expand Down
1 change: 1 addition & 0 deletions tests/test_action_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def test_write_key(self):
values='{"st2": "awesome"}',
)
# action_result is a requests.response object
assert action_result is not None

result = self.client.read("secret/stanley")
assert result["data"]["st2"] == "awesome"
Expand Down
5 changes: 0 additions & 5 deletions tests/vault_action_tests_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,16 @@ def build_dummy_pack_config(self, url="https://localhost:8200"):

dummy_pack_config = {
"url": url,

# pack config | relation | hvac.Client()
# ------------|----------|--------------
# cert | != | cert
# cert+verify | == | verify
"cert": server_cert_path,
"verify": True,

"auth_method": "token",

"token": token,

"role_id": None,
"secret_id": None,
}

return dummy_pack_config

0 comments on commit e8a95e7

Please sign in to comment.