Skip to content

Commit 6c57f94

Browse files
Axe Module Fix & Sonar Fixes (#46)
<!-- markdownlint-disable-next-line first-line-heading --> ## Description <!-- Describe your changes in detail. --> This fixes a minor issue with the Axe module making the methods static, and does some minor fixes addressed by SonarQube. ## Context <!-- Why is this change required? What problem does it solve? --> This is preventing the methods from being used as intended, and some have minor formatting issues. ## Type of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply. --> - [ ] Refactoring (non-breaking change) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would change existing functionality) - [x] Bug fix (non-breaking change which fixes an issue) ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply. --> - [x] I am familiar with the [contributing guidelines](https://github.com/nhs-england-tools/playwright-python-blueprint/blob/main/CONTRIBUTING.md) - [x] I have followed the code style of the project - [ ] I have added tests to cover my changes (where appropriate) - [ ] I have updated the documentation accordingly - [ ] This PR is a result of pair or mob programming --- ## Sensitive Information Declaration To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including [PII (Personal Identifiable Information) / PID (Personal Identifiable Data)](https://digital.nhs.uk/data-and-information/keeping-data-safe-and-benefitting-the-public) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter. - [x] I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.
1 parent 5cdcd6c commit 6c57f94

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

utils/axe.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class Axe():
1616
under test to identify any accessibility concerns.
1717
"""
1818

19+
@staticmethod
1920
def run(
2021
page: Page,
2122
filename: str = "",
@@ -56,6 +57,7 @@ def run(
5657
json_report_generated=json_report_generated,
5758
)
5859

60+
@staticmethod
5961
def run_list(
6062
page: Page,
6163
page_list: list[str],

utils/date_time_utils.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ class DateTimeUtils:
66
A utility class for doing common actions with datetimes.
77
"""
88

9-
def __init__(self):
10-
pass
11-
129
@staticmethod
1310
def current_datetime(format_date: str = "%d/%m/%Y %H:%M") -> str:
1411
"""Gets the current datetime in the specified format.

utils/nhs_number_tools.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ class NHSNumberTools:
88
"""
99
A utility class providing functionality around NHS numbers.
1010
"""
11-
def __init__(self) -> None:
12-
pass
1311

1412
@staticmethod
1513
def _nhs_number_checks(nhs_number: str) -> None:
@@ -21,7 +19,7 @@ def _nhs_number_checks(nhs_number: str) -> None:
2119
"""
2220
if not nhs_number.isnumeric():
2321
raise NHSNumberToolsException("The NHS number provided ({}) is not numeric.".format(nhs_number))
24-
if not len(nhs_number) == 10:
22+
if len(nhs_number) != 10:
2523
raise NHSNumberToolsException("The NHS number provided ({}) is not 10 digits.".format(nhs_number))
2624

2725
@staticmethod

utils/user_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def retrieve_user(user: str) -> dict:
2626
with open(USERS_FILE, 'r') as file:
2727
user_data = json.loads(file.read())
2828

29-
if not user in user_data:
29+
if user not in user_data:
3030
raise UserToolsException(f"User [{user}] is not present in users.json")
3131

3232
logger.debug(f"Returning user: {user_data[user]}")

0 commit comments

Comments
 (0)