Permalink
Browse files

Merge pull request #553 from jmchilton/test_lint

Fix to restore linting of tests directory.
  • Loading branch information...
jmchilton committed Sep 1, 2016
2 parents 6c03de8 + a8e797b commit ef4b9f401276e1d9d0b7d1bd60da214dd293378e
@@ -1,11 +1,11 @@
""" Test app to emulate planemo-relevant portions of the
the ToolShed API... for now :).
"""
import os
import json
import os
import tarfile
from uuid import uuid4

from uuid import uuid4
from xml.etree import ElementTree

from flask import (
@@ -1,17 +1,19 @@
from collections import namedtuple
import contextlib
import shutil
from tempfile import mkdtemp
import threading
from requests import post

from collections import namedtuple
from tempfile import mkdtemp

from requests import post
from werkzeug.serving import run_simple

from planemo import network_util

from .shed_app import (
app,
InMemoryShedDataModel,
)
from planemo import network_util

DEFAULT_OP_TIMEOUT = 2

@@ -1,20 +1,20 @@
import functools
import os
import time
import threading
import time
import uuid

from planemo.galaxy import api
from planemo import network_util
from planemo.galaxy import api
from planemo.io import kill_pid_file

from .test_utils import (
CliTestCase,
PROJECT_TEMPLATES_DIR,
skip_if_environ,
skip_unless_environ,
TEST_REPOS_DIR,
PROJECT_TEMPLATES_DIR,
TEST_DATA_DIR,
TEST_REPOS_DIR,
)

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

def _run(self, serve_args=[]):
cat_path = os.path.join(TEST_REPOS_DIR, "single_tool", "cat.xml")
test_cmd = [
"serve",
"--install_galaxy",
@@ -1,14 +1,15 @@
import functools
import os
import time
import threading
import time

from planemo import network_util

from .test_utils import (
CliTestCase,
skip_if_environ,
TEST_REPOS_DIR,
)
from planemo import network_util


class ShedServeTestCase(CliTestCase):
@@ -6,9 +6,9 @@
assert_exists,
CliTestCase,
PROJECT_TEMPLATES_DIR,
skip_unless_python_2_7,
skip_if_environ,
skip_unless_environ,
skip_unless_python_2_7,
TEST_DATA_DIR,
)

@@ -1,7 +1,8 @@
"""Test cases for the CommandIO abstraction in tool_builder."""

from planemo.tool_builder import CommandIO
from test_utils import assert_equal

from .test_utils import assert_equal


def test_simplest_command():
@@ -1,11 +1,11 @@
import os
import glob
import os
import tempfile

from .test_utils import (
CliTestCase,
TEST_REPOS_DIR,
skip_if_environ,
TEST_REPOS_DIR,
)


@@ -1,12 +1,12 @@
"""Unit tests for engines and runnables."""

import os

from planemo.engine import engine_context
from planemo.runnable import for_path
from planemo.runnable import get_outputs


from .test_utils import CWL_DRAFT3_DIR, TEST_DATA_DIR, test_context
from .test_utils import CWL_DRAFT3_DIR, test_context, TEST_DATA_DIR

A_CWL_TOOL = os.path.join(CWL_DRAFT3_DIR, "cat3-tool.cwl")
A_CWL_WORKFLOW = os.path.join(CWL_DRAFT3_DIR, "count-lines1-wf.cwl")
@@ -2,10 +2,10 @@
import contextlib
import os

from .test_utils import TempDirectoryContext, test_context

from planemo.galaxy.config import galaxy_config

from .test_utils import TempDirectoryContext, test_context


def test_defaults():
"""Test by default Galaxy files are stored in temp ``config_directory``."""
@@ -5,17 +5,18 @@
"""
import os

from planemo import network_util
from planemo import shed
from planemo.galaxy import galaxy_serve, shed_serve
from planemo.runnable import for_path

from .test_utils import (
CliTestCase,
PROJECT_TEMPLATES_DIR,
skip_if_environ,
TEST_REPOS_DIR,
TEST_DATA_DIR,
PROJECT_TEMPLATES_DIR,
TEST_REPOS_DIR,
)
from planemo.runnable import for_path
from planemo.galaxy import galaxy_serve, shed_serve
from planemo import network_util
from planemo import shed


class GalaxyServeTestCase(CliTestCase):
@@ -3,16 +3,15 @@
import os
import shutil

from .test_utils import (
test_context,
TempDirectoryTestCase,
TEST_DATA_DIR,
)

from planemo.galaxy.test import structures
from planemo.galaxy.test.actions import passed
from planemo.galaxy.test.actions import run_in_config

from .test_utils import (
TempDirectoryTestCase,
test_context,
TEST_DATA_DIR,
)

nose_1_3_report = os.path.join(TEST_DATA_DIR, "xunit_nose_1_3.xml")
nose_0_11_report = os.path.join(TEST_DATA_DIR, "xunit_nose_0_11.xml")
@@ -1,9 +1,10 @@
"""Test utilities for dealing with Galaxy workflows."""
import os

from .test_utils import TEST_DATA_DIR
from planemo.galaxy.workflows import describe_outputs

from .test_utils import TEST_DATA_DIR


def test_describe_outputs():
wf_path = os.path.join(TEST_DATA_DIR, "wf1.gxwf.yml")
@@ -1,9 +1,10 @@
import contextlib
import os

from .test_utils import io
from planemo import git

from .test_utils import io

EXPECTED_HELLO_REV = "1c36390f585f8baa953548c00fc18c58e32fcf8b"

COMMITTER_DATE = "GIT_COMMITTER_DATE='2000-01-01T00:00:00+0000'"
@@ -1,7 +1,7 @@
"""Test utilities from :module:`planemo.io`."""
from .test_utils import (
io,
assert_equal,
io,
)


@@ -1,10 +1,10 @@
import os
import glob
import os

from .test_utils import (
CliTestCase,
TEST_TOOLS_DIR,
TEST_REPOS_DIR,
TEST_TOOLS_DIR,
)


@@ -1,6 +1,5 @@
from .test_utils import (
CliTestCase,
skip_unless_environ,
)


@@ -2,21 +2,22 @@
"""

import os
import string
import random
import string

import yaml

from bioblend import toolshed

from planemo import io
from planemo.shed import username

from .test_utils import (
skip_unless_environ,
CliTestCase,
skip_unless_environ,
TEST_DIR
)

from planemo.shed import username
from planemo import io

SHED_TEMPLATE = string.Template("""owner: ${owner}
name: ${name}
@@ -1,6 +1,7 @@
from planemo import shed

from .test_utils import CliShedTestCase
from .test_utils import skip
from planemo import shed

CS1_DESCRIPTION = "The tool Cat 1 from the cat tool suite."
CS2_DESCRIPTION = "The tool Cat 2 from the cat tool suite."
@@ -1,19 +1,21 @@
""" Integration tests for shed_diff command.
"""

from os.path import join
from .test_utils import (
CliShedTestCase,
TEST_REPOS_DIR,
)
from planemo import io
import tempfile
import sys
import os
import sys
import tempfile

from os.path import join
from xml.etree import ElementTree

from planemo import io
from planemo.xml.diff import diff

from .test_shed_upload import update_package_1
from .test_utils import (
CliShedTestCase,
TEST_REPOS_DIR,
)

DIFF_LINES = [
"diff -r _workingdir_/related_file _custom_shed_/related_file",
@@ -1,8 +1,9 @@
import os

from .test_utils import TEST_DIR
from planemo.shed import diff

from .test_utils import TEST_DIR


def test_compare():
local = os.path.join(TEST_DIR, "repository_dependencies.xml")
@@ -3,10 +3,10 @@

import yaml

from .test_utils import TempDirectoryTestCase

from planemo import shed

from .test_utils import TempDirectoryTestCase


class ShedExpansionTestCase(TempDirectoryTestCase):

@@ -1,14 +1,14 @@
""" Test some lower-level utilities in planemo.shed.
"""
"""Test some lower-level utilities in planemo.shed."""

import os

from planemo import shed

from .test_utils import (
TEST_REPOS_DIR,
mock_shed_context,
TEST_REPOS_DIR,
)

from planemo import shed


def test_find_repository_id():
with mock_shed_context() as shed_context:
@@ -3,18 +3,20 @@
Specifically, tests for shed_upload, shed_download, and shed_create.
commands.
"""
from os.path import exists, join
import os
import tarfile
import shutil
import tarfile

from os.path import exists, join

from planemo import git
from planemo.io import shell

from .test_utils import (
assert_exists,
CliShedTestCase,
TEST_REPOS_DIR,
assert_exists,
)
from planemo.io import shell
from planemo import git


class ShedUploadTestCase(CliShedTestCase):
@@ -2,8 +2,8 @@
import os

from planemo.runnable import (
for_path,
cases,
for_path,
)

from .test_utils import TEST_DATA_DIR
Oops, something went wrong.

0 comments on commit ef4b9f4

Please sign in to comment.