Skip to content

Commit 550687e

Browse files
committed
tests: Run flake8 on tests and fix errors
The assertion added to test_distribution_format_format_only was apparently deleted at some point by accident.
1 parent 4002d71 commit 550687e

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

ckanext/dcatapchharvest/tests/test_dcatap_ch_parse.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import json
2-
from pprint import pprint
32

43
from rdflib import Graph, Literal, URIRef
54
from rdflib.namespace import RDF
@@ -339,6 +338,8 @@ def test_distribution_format_format_only(self):
339338

340339
resource = datasets[0]["resources"][0]
341340

341+
assert resource["format"] == "CSV"
342+
342343
def test_temporals_accepted_formats(self):
343344
contents = self._get_file_contents("dataset-datetimes.xml")
344345
p = RDFParser(profiles=["swiss_dcat_ap"])

ckanext/dcatapchharvest/tests/test_dcatap_ch_serialize.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@
77
import ckanext.dcatapchharvest.dcat_helpers as dh
88
from ckanext.dcat import utils
99
from ckanext.dcat.processors import RDFSerializer
10-
from ckanext.dcat.profiles import DCAT, DCT, FOAF, OWL, SCHEMA, VCARD, XSD
10+
from ckanext.dcat.profiles import DCAT, DCT, FOAF, OWL, VCARD, XSD
1111
from ckanext.dcatapchharvest.tests.base_test_classes import BaseSerializeTest
1212

1313
log = logging.getLogger(__name__)
1414

1515

1616
class TestDCATAPCHProfileSerializeDataset(BaseSerializeTest):
1717

18-
def test_graph_from_dataset(self):
18+
# This test is too complex, according to flake8. TODO: refactor it.
19+
def test_graph_from_dataset(self): # noqa C901
1920

2021
dataset = json.loads(self._get_file_contents("dataset.json"))
2122
extras = self._extras(dataset)

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[flake8]
2-
exclude = ckan,ckanext-harvest,ckanext/dcatapchharvest/tests,setup.py
2+
exclude = ckan,ckanext-harvest
33
max-complexity = 10

0 commit comments

Comments
 (0)