Skip to content
This repository was archived by the owner on Jul 10, 2024. It is now read-only.

Commit d5d5cc8

Browse files
committed
Remove debug logging and fix test.
Signed-off-by: Daniel Palmer <dan.palmer@anchore.com>
1 parent b45de19 commit d5d5cc8

File tree

1 file changed

+1
-24
lines changed

1 file changed

+1
-24
lines changed

tests/functional/test_account.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
from conftest import call, ExitCode
22
import json
3-
import logging
43
import pytest
54

65

7-
def get_logger(name):
8-
return logging.getLogger("conftest.%s" % name)
9-
10-
116
@pytest.mark.parametrize(
127
"sub_command, expected_code",
138
[
@@ -22,28 +17,10 @@ def get_logger(name):
2217
],
2318
)
2419
def test_unauthorized(sub_command, expected_code):
25-
logger = get_logger("test_unauthorized")
26-
2720
out, err, code = call(["anchore-cli", "account", sub_command])
28-
29-
if sub_command in ["list", "user", "whoami"]:
30-
logger.warning("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
31-
logger.warning("! sub_command: " + str(sub_command))
32-
logger.warning("! out: " + str(out))
33-
logger.warning("! err: " + str(err))
34-
logger.warning("! code: " + str(code))
35-
logger.warning("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
36-
3721
assert code == ExitCode(expected_code)
38-
if expected_code == 2:
22+
if sub_command in ["add", "del", "disable", "enable", "get"]:
3923
assert err.startswith("Usage: anchore-cli account {}".format(sub_command))
40-
else:
41-
if sub_command == "list":
42-
assert out.startswith("Unauthorized")
43-
elif sub_command == "whoami":
44-
assert out.startswith("Unauthorized")
45-
else:
46-
assert out.startswith("Usage: anchore-cli account {}".format(sub_command))
4724

4825

4926
class TesttList:

0 commit comments

Comments
 (0)