Skip to content

Commit

Permalink
Merge pull request #41 from tisnik/fix-PEP8-errors-in-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jpopelka authored Jun 7, 2017
2 parents fb53421 + 30e86b7 commit 83531ef
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions tests/storages/test_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

from ..conftest import rdb


class TestBayesianPostgres:
def setup_method(self, method):
rdb()
Expand Down
4 changes: 3 additions & 1 deletion tests/test_blackduck_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@
'yetAnotherKeyWithUrl': 'baz',
}


def test_blackduck_project():
project = BlackDuckProject(_PROJECT_DEF)
assert project.name == 'foobar'
assert project.id == 'aaaaa11111'
assert project.canonical_release_id == 'abcdef123456'
assert project.urls == {'keyWithUrl': 'foo', 'anotherKeyWithUrl': 'bar', 'yetAnotherKeyWithUrl': 'baz'}


def test_blackduck_release():
release = BlackDuckRelease(_RELEASE_DEF, 'phonyId')
assert release.id == 'abcdef123456'
assert release.version == '0.6.0'
assert release.released_at == NOW
assert release.released_at == NOW
2 changes: 1 addition & 1 deletion tests/test_data_normalizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def test_get_outermost_items(self):
result = self.sort_by_path(self._dataNormalizer.get_outermost_items(d))
assert len(result) == len(expected)
for i in range(len(expected)):
assert compare_dictionaries(result[i], expected[i]) == True
assert compare_dictionaries(result[i], expected[i])

@pytest.mark.parametrize('data, expected', [
({'pom.xml': {'dependencies': {'compile': {'g:a::': '1.0'}}}},
Expand Down
3 changes: 2 additions & 1 deletion tests/test_pulp.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@

from cucoslib.pulp import Pulp


def _pulp_client():
return Pulp(pulp_url="http://dummy.invalid", pulp_auth=(None, None))


@pytest.mark.offline
class TestPulp(object):

Expand Down Expand Up @@ -79,7 +81,6 @@ def test_get_cdn_metadata_for_repo(self):
assert metadata["content_set"] == [content_set]
assert metadata["rhn_channels"] == rhn_channels


def test_get_cdn_metadata_for_srpm(self):
# This just tests the response unpacking, the metadata health checks
# provide the full end-to-end integration testing against the CDN
Expand Down
2 changes: 2 additions & 0 deletions tests/test_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
load_all_worker_schemas,
assert_no_two_consecutive_schemas_are_same)


@pytest.mark.offline
class TestSchemaRef(object):

Expand All @@ -28,6 +29,7 @@ def test_next_model(self):
schema_ref = SchemaRef("example", "1-0-0")
assert schema_ref.next_model() == SchemaRef("example", "2-0-0")


@pytest.mark.offline
class TestSchemaLibrary(object):

Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from cucoslib.enums import EcosystemBackend
from cucoslib.errors import TaskError
from cucoslib.models import (Analysis, Ecosystem, Package, Version, create_db_scoped_session)
from cucoslib import utils # so that we can mock functions from here
from cucoslib import utils # so that we can mock functions from here
from cucoslib.utils import (get_all_files_from,
hidden_path_filter,
skip_git_files,
Expand Down
1 change: 1 addition & 0 deletions tests/workers/test_downstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def run(self, timeout=None, **kwargs):
return 0, stdout, ""
return MockBrewCommand


def _make_pulp_client(usage_to_report):
class MockPulpClient(object):
def get_cdn_metadata_for_srpm(self, srpm_filename):
Expand Down
1 change: 1 addition & 0 deletions tests/workers/test_licensecheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# Near-enough-for-our-purposes equivalent in Python 2.x
from distutils.spawn import find_executable as which


@pytest.mark.offline
@pytest.mark.usefixtures("dispatcher_setup")
class TestLicenseCheck(object):
Expand Down

0 comments on commit 83531ef

Please sign in to comment.