From 132166715e2e4c8395a6b9a3f86cb3698b3ca508 Mon Sep 17 00:00:00 2001 From: Scott Davis Date: Thu, 2 May 2024 11:54:09 -0600 Subject: [PATCH] chore: remove black in favor of ruff --- .vscode/extensions.json | 1 - .vscode/settings.json | 2 +- pyproject.toml | 2 - readme.md | 5 +- setup.py | 2 +- src/sweeper/__main__.py | 1 + src/sweeper/address_parser.py | 130 ++++++++++++++++-------------- src/sweeper/backup.py | 1 + src/sweeper/report.py | 90 ++++++++++++--------- src/sweeper/sweepers/addresses.py | 35 ++++---- src/sweeper/sweepers/invalids.py | 14 ++-- src/sweeper/sweepers/metadata.py | 1 + src/sweeper/workspace_info.py | 2 +- tests/test_address_parser.py | 1 + tests/test_addresses.py | 1 + tests/test_metadata.py | 8 +- 16 files changed, 156 insertions(+), 140 deletions(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index e984426..cd80e0d 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -5,7 +5,6 @@ "recommendations": [ "editorconfig.editorconfig", "njpwerner.autodocstring", - "ms-python.black-formatter", "ms-python.vscode-pylance", "ms-python.python", "donjayamanne.python-environment-manager", diff --git a/.vscode/settings.json b/.vscode/settings.json index aeab965..809f2de 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,6 @@ { "[python]": { - "editor.defaultFormatter": "ms-python.black-formatter", + "editor.defaultFormatter": "charliermarsh.ruff", "editor.formatOnSave": true }, "cSpell.words": [ diff --git a/pyproject.toml b/pyproject.toml index fe08126..414afc6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,8 +2,6 @@ line-length = 120 [tool.ruff.lint] ignore = ["E501"] -[tool.black] -line-length = 120 [tool.pytest.ini_options] minversion = "6.0" testpaths = ["tests", "src"] diff --git a/readme.md b/readme.md index 9e70ec1..9d30d2f 100644 --- a/readme.md +++ b/readme.md @@ -125,6 +125,7 @@ A normalized string representing the entire address that was passed into the con 1. install required dependencies to work on sweeper - `pip install -e ".[tests]"` 1. `test_metadata.py` uses a SQL database that needs to be restored via `src/sweeper/tests/data/Sweeper.bak` to your local SQL Server. -1. run tests: `pytest` -1. run linter: `ruff check .` 1. run sweeper: `python -m sweeper` +1. test: `pytest` +1. lint: `ruff check .` +1. format: `ruff format .` diff --git a/setup.py b/setup.py index c1ce77a..9f3674b 100644 --- a/setup.py +++ b/setup.py @@ -4,6 +4,7 @@ setup.py A module that installs sweeper as a module """ + import glob from os.path import basename, splitext from pathlib import Path @@ -59,7 +60,6 @@ "pytest-mock==3.*", "pytest-watch==4.*", "pytest==8.*", - "black==24.*", "ruff==0.*", ], }, diff --git a/src/sweeper/__main__.py b/src/sweeper/__main__.py index 0bf239a..d1126e9 100644 --- a/src/sweeper/__main__.py +++ b/src/sweeper/__main__.py @@ -22,6 +22,7 @@ sweeper sweep --workspace=c:\\data\\thing --try-fix --save-report=c:\\temp --backup-to=c:\\temp\\backup.gdb sweeper sweep addresses --workspace=c:\\data\\thing --try-fix --save-report=c:\\temp --backup-to=c:\\temp\\backup.gdb --field-name=ADDRESS """ + import datetime import logging import logging.handlers diff --git a/src/sweeper/address_parser.py b/src/sweeper/address_parser.py index 60317e6..96137cc 100644 --- a/src/sweeper/address_parser.py +++ b/src/sweeper/address_parser.py @@ -1,9 +1,10 @@ #!/usr/bin/env python # * coding: utf8 * -''' +""" address_parser.py A module that parses street addresses into their various parts. -''' +""" + import json import pprint import re @@ -12,16 +13,16 @@ import usaddress TAG_MAPPING = { - 'AddressNumber': 'address_number', - 'AddressNumberPrefix': 'address_number', - 'AddressNumberSuffix': 'address_number_suffix', - 'StreetNamePreDirectional': 'prefix_direction', - 'StreetName': 'street_name', + "AddressNumber": "address_number", + "AddressNumberPrefix": "address_number", + "AddressNumberSuffix": "address_number_suffix", + "StreetNamePreDirectional": "prefix_direction", + "StreetName": "street_name", # 'StreetNamePreModifier': 'street_name', #: handled in class below # 'StreetNamePreType': 'street_name', #: handled in class below - 'StreetNamePostDirectional': 'street_direction', - 'StreetNamePostModifier': 'street_type', - 'StreetNamePostType': 'street_type', + "StreetNamePostDirectional": "street_direction", + "StreetNamePostModifier": "street_type", + "StreetNamePostType": "street_type", # 'CornerOf': 'address1', # 'IntersectionSeparator': 'address1', # 'LandmarkName': 'address1', @@ -29,27 +30,28 @@ # 'USPSBoxGroupType': 'address1', # 'USPSBoxID': 'address1', # 'USPSBoxType': 'address1', - 'BuildingName': 'unit_id', - 'OccupancyType': 'unit_type', - 'OccupancyIdentifier': 'unit_id', - 'SubaddressIdentifier': 'unit_id', - 'SubaddressType': 'unit_type', - 'PlaceName': 'city', - 'StateName': 'state', - 'ZipCode': 'zip_code', - 'USPSBoxID': 'po_box' + "BuildingName": "unit_id", + "OccupancyType": "unit_type", + "OccupancyIdentifier": "unit_id", + "SubaddressIdentifier": "unit_id", + "SubaddressType": "unit_type", + "PlaceName": "city", + "StateName": "state", + "ZipCode": "zip_code", + "USPSBoxID": "po_box", } -TWO_CHAR_DIRECTIONS = ['NO', 'SO', 'EA', 'WE'] -with open(join(dirname(realpath(__file__)), 'street_types.json'), 'r') as file: +TWO_CHAR_DIRECTIONS = ["NO", "SO", "EA", "WE"] +with open(join(dirname(realpath(__file__)), "street_types.json"), "r") as file: STREET_TYPES = json.loads(file.read()) -HWY_REGEX = re.compile('(SR|STATE ROUTE|HIGHWAY)') -UNIT_VALUES_NOT_APPROPRIATE_FOR_HASH_SIGN = ['rear'] +HWY_REGEX = re.compile("(SR|STATE ROUTE|HIGHWAY)") +UNIT_VALUES_NOT_APPROPRIATE_FOR_HASH_SIGN = ["rear"] -class Address(): - ''' +class Address: + """ Class for parsing address strings - ''' + """ + address_number = None address_number_suffix = None prefix_direction = None @@ -64,14 +66,14 @@ class Address(): state = None def __init__(self, address_text): - parts, parsed_as = usaddress.tag(address_text.replace('.', ''), TAG_MAPPING) - if parsed_as not in ['Street Address', 'PO Box']: + parts, parsed_as = usaddress.tag(address_text.replace(".", ""), TAG_MAPPING) + if parsed_as not in ["Street Address", "PO Box"]: raise Exception(f'"{address_text}" is not recognized as a valid street address, or P.O. Box') for part in parts: try: value = parts[part].upper() - if part.endswith('direction'): + if part.endswith("direction"): value = normalize_direction(value) setattr(self, part, value) @@ -83,85 +85,95 @@ def __init__(self, address_text): try: #: e.g. US HWY - self.street_name = f'{normalize_street_name_pre_type(self.StreetNamePreType)} {self.street_name}' + self.street_name = f"{normalize_street_name_pre_type(self.StreetNamePreType)} {self.street_name}" del self.StreetNamePreType except AttributeError: pass try: - self.street_name = f'{self.StreetNamePreModifier} {self.street_name}' + self.street_name = f"{self.StreetNamePreModifier} {self.street_name}" del self.StreetNamePreModifier except AttributeError: pass #: look for two-character prefix directions which usaddress does not handle if self.street_name: - street_name_parts = self.street_name.split(' ') + street_name_parts = self.street_name.split(" ") if len(street_name_parts) > 1: if street_name_parts[0].upper() in TWO_CHAR_DIRECTIONS and self.prefix_direction is None: self.prefix_direction = normalize_direction(street_name_parts[0]) - self.street_name = ' '.join(street_name_parts[1:]) + self.street_name = " ".join(street_name_parts[1:]) elif street_name_parts[-1].upper() in TWO_CHAR_DIRECTIONS and self.street_direction is None: self.street_direction = normalize_direction(street_name_parts[-1]) - self.street_name = ' '.join(street_name_parts[:-1]) + self.street_name = " ".join(street_name_parts[:-1]) if self.street_type is not None: #: handle multiple street_types (assume only the last one is valid and move all others to the street name) - if len(self.street_type.split(' ')) > 1: - parsed_street_types = self.street_type.split(' ') - self.street_name += ' ' + ' '.join(parsed_street_types[:-1]) + if len(self.street_type.split(" ")) > 1: + parsed_street_types = self.street_type.split(" ") + self.street_name += " " + " ".join(parsed_street_types[:-1]) self.street_type = parsed_street_types[-1] try: self.street_type = normalize_street_type(self.street_type) except InvalidStreetTypeError: #: must be part of the street name - self.street_name += f' {self.street_type}' + self.street_name += f" {self.street_type}" self.street_type = None if self.unit_id is not None: #: add `#` if there is not unit type and the unit is numeric - if not self.unit_id.startswith('#') and self.unit_type is None and self.unit_id.lower() not in UNIT_VALUES_NOT_APPROPRIATE_FOR_HASH_SIGN: - self.unit_id = f'# {self.unit_id}' + if ( + not self.unit_id.startswith("#") + and self.unit_type is None + and self.unit_id.lower() not in UNIT_VALUES_NOT_APPROPRIATE_FOR_HASH_SIGN + ): + self.unit_id = f"# {self.unit_id}" #: strip `#` if there is a unit type - elif self.unit_id.startswith('#') and self.unit_type is not None: + elif self.unit_id.startswith("#") and self.unit_type is not None: self.unit_id = self.unit_id[1:].strip() def __repr__(self): properties = vars(self) - properties.update({'normalized': self.normalized}) + properties.update({"normalized": self.normalized}) - return f'Parsed Address:\n{pprint.pformat(properties)}' + return f"Parsed Address:\n{pprint.pformat(properties)}" @property def normalized(self): - ''' + """ getter for normalized address string - ''' + """ if self.po_box is not None: - return f'PO BOX {self.po_box}' + return f"PO BOX {self.po_box}" parts = [ - self.address_number, self.address_number_suffix, self.prefix_direction, self.street_name, self.street_type, self.street_direction, self.unit_type, - self.unit_id + self.address_number, + self.address_number_suffix, + self.prefix_direction, + self.street_name, + self.street_type, + self.street_direction, + self.unit_type, + self.unit_id, ] - return ' '.join([part for part in parts if part is not None]) + return " ".join([part for part in parts if part is not None]) def normalize_direction(direction_text): - ''' + """ returns the single letter corresponding to the input direction - ''' + """ return direction_text[0].upper() def normalize_street_type(type_text): - ''' + """ returns the standard abbreviation for the input street type - ''' + """ type_text = type_text.upper() for abbreviation, values in STREET_TYPES.items(): @@ -172,18 +184,18 @@ def normalize_street_type(type_text): def normalize_street_name_pre_type(text): - '''normalizes highways by doing things like replaces SR with HWY and removes US + """normalizes highways by doing things like replaces SR with HWY and removes US No need to worried about casing or "."s because usaddress has already taken care of them by this point. - ''' - return HWY_REGEX.sub('HWY', text).replace('US ', '') + """ + return HWY_REGEX.sub("HWY", text).replace("US ", "") class InvalidStreetTypeError(Exception): - ''' + """ exception for when the street type does not have a corresponding value in street_types.json - ''' + """ def __init__(self, type_text): super().__init__() - self.message = f'No matching abbreviation found for {type_text}' + self.message = f"No matching abbreviation found for {type_text}" diff --git a/src/sweeper/backup.py b/src/sweeper/backup.py index d851c4c..9d336aa 100644 --- a/src/sweeper/backup.py +++ b/src/sweeper/backup.py @@ -4,6 +4,7 @@ backup.py A module that creates a gdb if it doesn't exist and inserts a feature class """ + import logging import os from datetime import datetime diff --git a/src/sweeper/report.py b/src/sweeper/report.py index b94854a..5200209 100644 --- a/src/sweeper/report.py +++ b/src/sweeper/report.py @@ -1,23 +1,24 @@ #!/usr/bin/env python # * coding: utf8 * -''' +""" report.py A module that contains the templates for the reports and functions to format data into the report -''' +""" import os import io from datetime import datetime import logging -log = logging.getLogger('sweeper') +log = logging.getLogger("sweeper") + def _print_items(report, key, writer): - '''print out issues or fixes + """print out issues or fixes report: report dictionary key: 'issues' | 'fixes' writer: function - ''' + """ try: items = report[key] except KeyError: @@ -25,38 +26,39 @@ def _print_items(report, key, writer): items_found = len(items) if items_found == 0: - writer(f'No {key} found!') - writer('---') + writer(f"No {key} found!") + writer("---") return - writer(f'{items_found} {key} found:') + writer(f"{items_found} {key} found:") has_oids = True if isinstance(items, list): for item in items: if isinstance(item, int): - writer(f' ObjectID {item}') + writer(f" ObjectID {item}") else: #: issues not associated with a specific row (e.g. metadata) has_oids = False - writer(f' {item}') + writer(f" {item}") else: #: must be dict for oid in items: - writer(f' ObjectID {oid}: {items[oid]}') + writer(f" ObjectID {oid}: {items[oid]}") if has_oids: - writer(f'\nSelect statement to view {key} in ArcGIS:') + writer(f"\nSelect statement to view {key} in ArcGIS:") statement = f'OBJECTID IN ({", ".join([str(oid) for oid in items])})' writer(statement) - writer('---') + writer("---") + def _generate_report(writer, reports): if len(reports) == 0: - writer('No issues found!') + writer("No issues found!") return None @@ -64,62 +66,70 @@ def _generate_report(writer, reports): for report in reports: writer(f'{report["title"]} Report for {report["feature_class"]}') - _print_items(report, 'fixes', writer) - _print_items(report, 'issues', writer) + _print_items(report, "fixes", writer) + _print_items(report, "issues", writer) + def save_report(reports, save_directory): - ''' + """ save_directory - folder sweeper_run_YYYYMMDD_HHmm - featureclassname_sweepername_numberofissues.txt `Counties_Empties_5.txt` `Counties_Empties_0.txt` - ''' + """ report_directory = _create_report_directory(save_directory) for report in reports: file_name = _get_file_name(report) file_path = os.path.join(report_directory, file_name) - with open(file_path, 'w') as textfile: + with open(file_path, "w") as textfile: + def write_lines(text): - textfile.writelines(f'{text}\n') + textfile.writelines(f"{text}\n") _generate_report(write_lines, [report]) + def print_report(reports): _generate_report(print, reports) + def _get_file_name(report): - title = report['title'].replace(' ', '') + title = report["title"].replace(" ", "") return f'{report["feature_class"]}_{title}_{len(report["issues"])}.txt' + def _create_report_directory(parent_directory): - now = datetime.now().strftime('%Y%m%d_%H%M') + now = datetime.now().strftime("%Y%m%d_%H%M") - report_directory = os.path.join(parent_directory, f'sweeper_run_{now}') + report_directory = os.path.join(parent_directory, f"sweeper_run_{now}") os.makedirs(report_directory) return report_directory + def format_message(reports): message = io.StringIO() - now = datetime.now().strftime('%Y%m%d_%H%M') - message.write(f'
Email summary for {now} Sweeper run \n\n
') + now = datetime.now().strftime("%Y%m%d_%H%M") + message.write(f"
Email summary for {now} Sweeper run \n\n
") if not reports: - message.write('
No changes identified or Sweeper tests run\n
') + message.write("
No changes identified or Sweeper tests run\n
") else: for report in reports: - message.write(f'
{len(report["issues"]):4} Issues \t {report["title"]:<16} \t {report["feature_class"]:<50} \n
') + message.write( + f'
{len(report["issues"]):4} Issues \t {report["title"]:<16} \t {report["feature_class"]:<50} \n
' + ) return message def _log_items(report, key): - '''print out issues or fixes to log + """print out issues or fixes to log report: report dictionary key: 'issues' | 'fixes' - ''' + """ try: items = report[key] except KeyError: @@ -127,39 +137,39 @@ def _log_items(report, key): items_found = len(items) if items_found == 0: - log.info(f'No {key} found!') - log.info('---') + log.info(f"No {key} found!") + log.info("---") return - log.info(f'{items_found} {key} found:') + log.info(f"{items_found} {key} found:") has_oids = True if isinstance(items, list): for item in items: if isinstance(item, int): - log.info(f' ObjectID {item}') + log.info(f" ObjectID {item}") else: #: issues not associated with a specific row (e.g. metadata) has_oids = False - log.info(f' {item}') + log.info(f" {item}") else: #: must be dict for oid in items: - log.info(f' ObjectID {oid}: {items[oid]}') + log.info(f" ObjectID {oid}: {items[oid]}") if has_oids: - log.info(f'\nSelect statement to view {key} in ArcGIS:') + log.info(f"\nSelect statement to view {key} in ArcGIS:") statement = f'OBJECTID IN ({", ".join([str(oid) for oid in items])})' log.info(statement) - log.info('---') + log.info("---") def add_to_log(reports): if len(reports) == 0: - log.info('No issues found!') + log.info("No issues found!") return None @@ -167,5 +177,5 @@ def add_to_log(reports): for report in reports: log.info(f'{report["title"]} Report for {report["feature_class"]}') - _log_items(report, 'fixes') - _log_items(report, 'issues') + _log_items(report, "fixes") + _log_items(report, "issues") diff --git a/src/sweeper/sweepers/addresses.py b/src/sweeper/sweepers/addresses.py index 98ef9b7..448c72b 100644 --- a/src/sweeper/sweepers/addresses.py +++ b/src/sweeper/sweepers/addresses.py @@ -1,18 +1,18 @@ #!/usr/bin/env python # * coding: utf8 * -''' +""" addresses.py A sweeper that works on address fields -''' +""" import arcpy from ..address_parser import Address -class AddressTest(): - '''A class that validates address data - ''' +class AddressTest: + """A class that validates address data""" + def __init__(self, workspace, table_name, field_name): self.workspace = workspace self.table_name = table_name @@ -20,13 +20,12 @@ def __init__(self, workspace, table_name, field_name): self.oids_with_issues = [] def sweep(self): - '''Loop through all values and check addresses for problems returning a report - ''' - report = {'title': 'Address Test', 'feature_class': self.table_name, 'issues': {}} - required_street_address_parts = set(['address_number', 'street_name']) + """Loop through all values and check addresses for problems returning a report""" + report = {"title": "Address Test", "feature_class": self.table_name, "issues": {}} + required_street_address_parts = set(["address_number", "street_name"]) with arcpy.EnvManager(workspace=self.workspace): - with arcpy.da.SearchCursor(self.table_name, ['OID@', self.field_name]) as search_cursor: + with arcpy.da.SearchCursor(self.table_name, ["OID@", self.field_name]) as search_cursor: for oid, address in search_cursor: issue_message = None try: @@ -37,30 +36,32 @@ def sweep(self): if issue_message is None: parts_found = set(parsed_address.__dict__) missing_parts = required_street_address_parts - parts_found - if len(missing_parts) > 0 and 'po_box' not in parts_found: + if len(missing_parts) > 0 and "po_box" not in parts_found: issue_message = f'missing address parts: {", ".join(missing_parts)}' elif parsed_address.normalized != address: - issue_message = f'address not fully normalized: "{address}" -> "{parsed_address.normalized}"' + issue_message = ( + f'address not fully normalized: "{address}" -> "{parsed_address.normalized}"' + ) if issue_message is not None: - report['issues'][oid] = issue_message + report["issues"][oid] = issue_message self.oids_with_issues.append(oid) return report def try_fix(self): - report = {'title': 'Address Try Fix', 'feature_class': self.table_name, 'issues': {}, 'fixes': {}} + report = {"title": "Address Try Fix", "feature_class": self.table_name, "issues": {}, "fixes": {}} with arcpy.EnvManager(workspace=self.workspace): describe = arcpy.da.Describe(self.table_name) where = f'{describe["OIDFieldName"]} IN ({", ".join([str(oid) for oid in self.oids_with_issues])})' - with arcpy.da.UpdateCursor(self.table_name, ['OID@', self.field_name], where_clause=where) as update_cursor: + with arcpy.da.UpdateCursor(self.table_name, ["OID@", self.field_name], where_clause=where) as update_cursor: for oid, address in update_cursor: try: parsed_address = Address(address) update_cursor.updateRow((oid, parsed_address.normalized)) - report['fixes'][oid] = f'{address} -> {parsed_address.normalized}' + report["fixes"][oid] = f"{address} -> {parsed_address.normalized}" except Exception as exception: - report['issues'][oid] = str(exception) + report["issues"][oid] = str(exception) return report diff --git a/src/sweeper/sweepers/invalids.py b/src/sweeper/sweepers/invalids.py index 3699a07..2ad186a 100644 --- a/src/sweeper/sweepers/invalids.py +++ b/src/sweeper/sweepers/invalids.py @@ -2,20 +2,16 @@ # * coding: utf8 * -class InvalidSweeper(): - '''A class that identifies invalid geometry objects and returns a report dictionary - ''' +class InvalidSweeper: + """A class that identifies invalid geometry objects and returns a report dictionary""" + def __init__(self, workspace, table_name): self.report = {} self.workspace = workspace self.table_name = table_name - def sweep(self): - '''A method to find invalid geometries and return a report dictionary - ''' - + """A method to find invalid geometries and return a report dictionary""" def try_fix(self): - '''A method to that attempts to repair records with invalid geometries - ''' + """A method to that attempts to repair records with invalid geometries""" diff --git a/src/sweeper/sweepers/metadata.py b/src/sweeper/sweepers/metadata.py index 9b1d91e..20f8761 100644 --- a/src/sweeper/sweepers/metadata.py +++ b/src/sweeper/sweepers/metadata.py @@ -4,6 +4,7 @@ metadata.py A sweeper that checks geodatabase metadata """ + import logging import re from os.path import dirname, join, realpath diff --git a/src/sweeper/workspace_info.py b/src/sweeper/workspace_info.py index 949253b..7b2684a 100644 --- a/src/sweeper/workspace_info.py +++ b/src/sweeper/workspace_info.py @@ -4,6 +4,7 @@ workspace_info.py A module that gets information about the workspace, including a list of feature classes. """ + import datetime import logging from pathlib import Path @@ -64,7 +65,6 @@ def get_featureclasses(workspace_path): #: A function to return a list of feature classes based on the change detection table. def get_change_detection(): - checked_date = read_last_check_date() if checked_date: diff --git a/tests/test_address_parser.py b/tests/test_address_parser.py index 14c8533..3c2567f 100644 --- a/tests/test_address_parser.py +++ b/tests/test_address_parser.py @@ -4,6 +4,7 @@ test_address_parser.py tests for the address parser module """ + import pytest from sweeper.address_parser import Address, InvalidStreetTypeError, normalize_direction, normalize_street_type diff --git a/tests/test_addresses.py b/tests/test_addresses.py index ed91286..df7e7a3 100644 --- a/tests/test_addresses.py +++ b/tests/test_addresses.py @@ -4,6 +4,7 @@ test_addresses.py tests for the addresses sweeper """ + from os import path # ruff: isort: off diff --git a/tests/test_metadata.py b/tests/test_metadata.py index d1b7a61..f669c8e 100644 --- a/tests/test_metadata.py +++ b/tests/test_metadata.py @@ -4,6 +4,7 @@ test_metadata.py a module that tests the metadata sweeper """ + from os import path from unittest.mock import Mock @@ -38,7 +39,6 @@ def does_not_contain_issue_with_text(issues, text): @pytest.mark.skipif(should_skip, reason="No test SDE detected, skipping suit") class TestMetadataSweeper: - def test_no_tags(self): tool = MetadataTest(workspace, "Sweeper.CADASTRE.MissingTags") report = tool.sweep() @@ -55,7 +55,6 @@ def test_title_cased_tags(self): @pytest.mark.skipif(should_skip, reason="No test SDE detected, skipping suit") class TestTitleCaseTag: - def test_title_case_tag(self): #: input, expected tests = [ @@ -72,7 +71,6 @@ def test_title_case_tag(self): @pytest.mark.skipif(should_skip, reason="No test SDE detected, skipping suit") class TestUpdateTags: - def test_update_tags(self): results = update_tags(["a", "b", "c", "d"], ["b", "c"], ["B", "E"]) expected = ["a", "d", "B", "E"] @@ -82,7 +80,6 @@ def test_update_tags(self): @pytest.mark.skipif(should_skip, reason="No test SDE detected, skipping suit") class TestSummary: - def test_summary_longer_than_description(self): tool = MetadataTest(workspace, "Sweeper.CADASTRE.SummaryLongerThanDescription") report = tool.sweep() @@ -98,7 +95,6 @@ def test_summary_too_long(self): @pytest.mark.skipif(should_skip, reason="No test SDE detected, skipping suit") class TestDescriptionParsing: - def test_get_description_text_only(self): input = '

This is a short description.

' @@ -110,7 +106,6 @@ def test_handles_none(self): @pytest.mark.skipif(should_skip, reason="No test SDE detected, skipping suit") class TestDescriptionChecks: - def test_find_data_page_link(self): tool = MetadataTest(workspace, "Sweeper.CADASTRE.WithoutDataPageLink") report = tool.sweep() @@ -126,7 +121,6 @@ def test_existing_link(self): @pytest.mark.skipif(should_skip, reason="No test SDE detected, skipping suit") class TestUseLimitation: - def test_correct_use_limitation(self): tool = MetadataTest(workspace, "Sweeper.CADASTRE.CorrectUseLimitations") report = tool.sweep()