Skip to content

Commit a8e797b

Browse files
committed
Fix to restore linting of tests directory.
Fix up regressions missed while linting was off and add import order linting for the whole module.
1 parent a152f3c commit a8e797b

28 files changed

+93
-80
lines changed

tests/shed_app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
""" Test app to emulate planemo-relevant portions of the
22
the ToolShed API... for now :).
33
"""
4-
import os
54
import json
5+
import os
66
import tarfile
7-
from uuid import uuid4
87

8+
from uuid import uuid4
99
from xml.etree import ElementTree
1010

1111
from flask import (

tests/shed_app_test_utils.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
from collections import namedtuple
21
import contextlib
32
import shutil
4-
from tempfile import mkdtemp
53
import threading
6-
from requests import post
74

5+
from collections import namedtuple
6+
from tempfile import mkdtemp
7+
8+
from requests import post
89
from werkzeug.serving import run_simple
910

11+
from planemo import network_util
12+
1013
from .shed_app import (
1114
app,
1215
InMemoryShedDataModel,
1316
)
14-
from planemo import network_util
1517

1618
DEFAULT_OP_TIMEOUT = 2
1719

tests/test_cmd_serve.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import functools
22
import os
3-
import time
43
import threading
4+
import time
55
import uuid
66

7-
from planemo.galaxy import api
87
from planemo import network_util
8+
from planemo.galaxy import api
99
from planemo.io import kill_pid_file
1010

1111
from .test_utils import (
1212
CliTestCase,
13+
PROJECT_TEMPLATES_DIR,
1314
skip_if_environ,
1415
skip_unless_environ,
15-
TEST_REPOS_DIR,
16-
PROJECT_TEMPLATES_DIR,
1716
TEST_DATA_DIR,
17+
TEST_REPOS_DIR,
1818
)
1919

2020
TEST_HISTORY_NAME = "Cool History 42"
@@ -106,7 +106,6 @@ def _launch_thread_and_wait(self, func, args=[]):
106106
assert network_util.wait_net_service("127.0.0.1", port)
107107

108108
def _run(self, serve_args=[]):
109-
cat_path = os.path.join(TEST_REPOS_DIR, "single_tool", "cat.xml")
110109
test_cmd = [
111110
"serve",
112111
"--install_galaxy",

tests/test_cmd_shed_serve.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import functools
22
import os
3-
import time
43
import threading
4+
import time
5+
6+
from planemo import network_util
57

68
from .test_utils import (
79
CliTestCase,
810
skip_if_environ,
911
TEST_REPOS_DIR,
1012
)
11-
from planemo import network_util
1213

1314

1415
class ShedServeTestCase(CliTestCase):

tests/test_cmd_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
assert_exists,
77
CliTestCase,
88
PROJECT_TEMPLATES_DIR,
9-
skip_unless_python_2_7,
109
skip_if_environ,
1110
skip_unless_environ,
11+
skip_unless_python_2_7,
1212
TEST_DATA_DIR,
1313
)
1414

tests/test_command_io.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
"""Test cases for the CommandIO abstraction in tool_builder."""
22

33
from planemo.tool_builder import CommandIO
4-
from test_utils import assert_equal
4+
5+
from .test_utils import assert_equal
56

67

78
def test_simplest_command():

tests/test_dependency_script.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import os
21
import glob
2+
import os
33
import tempfile
44

55
from .test_utils import (
66
CliTestCase,
7-
TEST_REPOS_DIR,
87
skip_if_environ,
8+
TEST_REPOS_DIR,
99
)
1010

1111

tests/test_engines.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"""Unit tests for engines and runnables."""
2+
23
import os
34

45
from planemo.engine import engine_context
56
from planemo.runnable import for_path
67
from planemo.runnable import get_outputs
78

8-
9-
from .test_utils import CWL_DRAFT3_DIR, TEST_DATA_DIR, test_context
9+
from .test_utils import CWL_DRAFT3_DIR, test_context, TEST_DATA_DIR
1010

1111
A_CWL_TOOL = os.path.join(CWL_DRAFT3_DIR, "cat3-tool.cwl")
1212
A_CWL_WORKFLOW = os.path.join(CWL_DRAFT3_DIR, "count-lines1-wf.cwl")

tests/test_galaxy_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
import contextlib
33
import os
44

5-
from .test_utils import TempDirectoryContext, test_context
6-
75
from planemo.galaxy.config import galaxy_config
86

7+
from .test_utils import TempDirectoryContext, test_context
8+
99

1010
def test_defaults():
1111
"""Test by default Galaxy files are stored in temp ``config_directory``."""

tests/test_galaxy_serve.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@
55
"""
66
import os
77

8+
from planemo import network_util
9+
from planemo import shed
10+
from planemo.galaxy import galaxy_serve, shed_serve
11+
from planemo.runnable import for_path
12+
813
from .test_utils import (
914
CliTestCase,
15+
PROJECT_TEMPLATES_DIR,
1016
skip_if_environ,
11-
TEST_REPOS_DIR,
1217
TEST_DATA_DIR,
13-
PROJECT_TEMPLATES_DIR,
18+
TEST_REPOS_DIR,
1419
)
15-
from planemo.runnable import for_path
16-
from planemo.galaxy import galaxy_serve, shed_serve
17-
from planemo import network_util
18-
from planemo import shed
1920

2021

2122
class GalaxyServeTestCase(CliTestCase):

0 commit comments

Comments
 (0)