Skip to content

Commit

Permalink
Merge pull request #1216 from MVrachev/fix-imports-and-default
Browse files Browse the repository at this point in the history
Fix imports and default value for function arg
  • Loading branch information
joshuagl committed Nov 25, 2020
2 parents 481496c + 028d1bc commit e005801
Show file tree
Hide file tree
Showing 28 changed files with 31 additions and 29 deletions.
2 changes: 1 addition & 1 deletion tests/test_api.py
Expand Up @@ -18,7 +18,7 @@
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta

import utils
from tests import utils

# TODO: Remove case handling when fully dropping support for versions >= 3.6
IS_PY_VERSION_SUPPORTED = sys.version_info >= (3, 6)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_arbitrary_package_attack.py
Expand Up @@ -52,7 +52,7 @@
import tuf.client.updater as updater
import tuf.unittest_toolbox as unittest_toolbox

import utils
from tests import utils

import securesystemslib
import six
Expand Down
2 changes: 1 addition & 1 deletion tests/test_developer_tool.py
Expand Up @@ -41,7 +41,7 @@
from tuf.developer_tool import METADATA_DIRECTORY_NAME
from tuf.developer_tool import TARGETS_DIRECTORY_NAME

import utils
from tests import utils

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_download.py
Expand Up @@ -47,7 +47,7 @@
import tuf.unittest_toolbox as unittest_toolbox
import tuf.exceptions

import utils
from tests import utils

import requests.exceptions

Expand Down
2 changes: 1 addition & 1 deletion tests/test_endless_data_attack.py
Expand Up @@ -54,7 +54,7 @@
import tuf.unittest_toolbox as unittest_toolbox
import tuf.roledb

import utils
from tests import utils

import securesystemslib
import six
Expand Down
2 changes: 1 addition & 1 deletion tests/test_extraneous_dependencies_attack.py
Expand Up @@ -57,7 +57,7 @@
import tuf.keydb
import tuf.unittest_toolbox as unittest_toolbox

import utils
from tests import utils

import securesystemslib
import six
Expand Down
2 changes: 1 addition & 1 deletion tests/test_formats.py
Expand Up @@ -36,7 +36,7 @@
import tuf
import tuf.formats

import utils
from tests import utils

import securesystemslib
import securesystemslib.util
Expand Down
2 changes: 1 addition & 1 deletion tests/test_indefinite_freeze_attack.py
Expand Up @@ -68,7 +68,7 @@
import tuf.keydb
import tuf.exceptions

import utils
from tests import utils

import securesystemslib
import six
Expand Down
2 changes: 1 addition & 1 deletion tests/test_key_revocation_integration.py
Expand Up @@ -52,7 +52,7 @@
import tuf.unittest_toolbox as unittest_toolbox
import tuf.client.updater as updater

import utils
from tests import utils

import securesystemslib
import six
Expand Down
2 changes: 1 addition & 1 deletion tests/test_keydb.py
Expand Up @@ -39,7 +39,7 @@
import tuf.keydb
import tuf.log

import utils
from tests import utils

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_log.py
Expand Up @@ -33,7 +33,7 @@
import securesystemslib
import securesystemslib.util

import utils
from tests import utils

from six.moves import reload_module

Expand Down
2 changes: 1 addition & 1 deletion tests/test_mirrors.py
Expand Up @@ -34,7 +34,7 @@
import tuf.mirrors as mirrors
import tuf.unittest_toolbox as unittest_toolbox

import utils
from tests import utils

import securesystemslib
import securesystemslib.util
Expand Down
2 changes: 1 addition & 1 deletion tests/test_mix_and_match_attack.py
Expand Up @@ -53,7 +53,7 @@
import tuf.roledb
import tuf.keydb

import utils
from tests import utils

import six

Expand Down
2 changes: 1 addition & 1 deletion tests/test_multiple_repositories_integration.py
Expand Up @@ -45,7 +45,7 @@
import tuf.unittest_toolbox as unittest_toolbox
import tuf.repository_tool as repo_tool

import utils
from tests import utils

import six
import securesystemslib
Expand Down
2 changes: 1 addition & 1 deletion tests/test_proxy_use.py
Expand Up @@ -46,7 +46,7 @@
import tuf.unittest_toolbox as unittest_toolbox
import tuf.exceptions

import utils
from tests import utils

import six

Expand Down
2 changes: 1 addition & 1 deletion tests/test_replay_attack.py
Expand Up @@ -52,7 +52,7 @@
import tuf.repository_tool as repo_tool
import tuf.unittest_toolbox as unittest_toolbox

import utils
from tests import utils

import securesystemslib
import six
Expand Down
2 changes: 1 addition & 1 deletion tests/test_repository_lib.py
Expand Up @@ -50,7 +50,7 @@
import tuf.repository_lib as repo_lib
import tuf.repository_tool as repo_tool

import utils
from tests import utils

import securesystemslib
import securesystemslib.exceptions
Expand Down
2 changes: 1 addition & 1 deletion tests/test_repository_tool.py
Expand Up @@ -44,7 +44,7 @@
import tuf.keydb
import tuf.repository_tool as repo_tool

import utils
from tests import utils

import securesystemslib
import securesystemslib.exceptions
Expand Down
2 changes: 1 addition & 1 deletion tests/test_roledb.py
Expand Up @@ -38,7 +38,7 @@
import tuf.exceptions
import tuf.log

import utils
from tests import utils

import securesystemslib
import securesystemslib.keys
Expand Down
2 changes: 1 addition & 1 deletion tests/test_root_versioning_integration.py
Expand Up @@ -40,7 +40,7 @@
import tuf.keydb
import tuf.repository_tool as repo_tool

import utils
from tests import utils

import securesystemslib
import securesystemslib.storage
Expand Down
2 changes: 1 addition & 1 deletion tests/test_sig.py
Expand Up @@ -42,7 +42,7 @@
import tuf.sig
import tuf.exceptions

import utils
from tests import utils

import securesystemslib
import securesystemslib.keys
Expand Down
2 changes: 1 addition & 1 deletion tests/test_slow_retrieval_attack.py
Expand Up @@ -58,7 +58,7 @@
import tuf.roledb
import tuf.keydb

import utils
from tests import utils

import six

Expand Down
2 changes: 1 addition & 1 deletion tests/test_tutorial.py
Expand Up @@ -44,7 +44,7 @@

from tuf.repository_tool import * # part of TUTORIAL.md

import utils
from tests import utils

import securesystemslib.exceptions

Expand Down
2 changes: 1 addition & 1 deletion tests/test_unittest_toolbox.py
Expand Up @@ -35,7 +35,7 @@

import tuf.unittest_toolbox as unittest_toolbox

import utils
from tests import utils

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_updater.py
Expand Up @@ -71,7 +71,7 @@
import tuf.unittest_toolbox as unittest_toolbox
import tuf.client.updater as updater

import utils
from tests import utils

import securesystemslib
import six
Expand Down
2 changes: 1 addition & 1 deletion tests/test_updater_root_rotation_integration.py
Expand Up @@ -59,7 +59,7 @@
import tuf.client.updater as updater
import tuf.settings

import utils
from tests import utils

import securesystemslib
import six
Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils.py
Expand Up @@ -28,7 +28,7 @@

import tuf.unittest_toolbox as unittest_toolbox

import utils
from tests import utils

logger = logging.getLogger(__name__)

Expand Down
6 changes: 4 additions & 2 deletions tests/utils.py
Expand Up @@ -156,17 +156,19 @@ class TestServerProcess():
List of additional arguments for the command
which will start the subprocess.
More precisely "python -u <path_to_server> <port> <extra_cmd_args>".
Default is empty list.
When no list is provided, an empty list ("[]") will be assigned to it.
"""


def __init__(self, log, server='simple_server.py',
timeout=10, popen_cwd=".", extra_cmd_args=[]):
timeout=10, popen_cwd=".", extra_cmd_args=None):

self.server = server
self.__logger = log
# Stores popped messages from the queue.
self.__logged_messages = []
if extra_cmd_args is None:
extra_cmd_args = []

try:
self._start_server(timeout, extra_cmd_args, popen_cwd)
Expand Down

0 comments on commit e005801

Please sign in to comment.