Skip to content

feature:Unit Tests for Site.py - #85

Merged
DiFronzo merged 1 commit into
WikimediaNorge:mainfrom
juancaCeb:Issue#79
Jun 8, 2025
Merged

feature:Unit Tests for Site.py#85
DiFronzo merged 1 commit into
WikimediaNorge:mainfrom
juancaCeb:Issue#79

Conversation

@juancaCeb

Copy link
Copy Markdown
Contributor

Description

It confirms that standard prefixes like 'en' and 'de' are properly registered, while also validating the behavior with edge cases such as an empty string (''), None, capitalized forms like 'UPPERcase', and prefixes with leading/trailing whitespace like ' en '. The tests also verify that the class remains working when unknown or invalid prefixes (like 'zz', 'not_in_map', or the integer 42) are passed and they are not added to the interwikimap.

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • ✅ Test

Related Tickets & Documents

Fixes #79

Tested?

  • 👍 yes

Added to documentation?

  • 📜 README.md
  • 📖 own file under the docs folder
  • 🙅 no documentation needed

@DiFronzo
DiFronzo requested a review from Copilot May 30, 2025 15:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds unit tests for the Site class functionality, focusing on verifying standard and edge-case prefix behaviors, as well as ensuring proper formatting in link generation and string representations.

  • Added tests to validate registration of standard prefixes and handling of edge cases (empty strings, None, unwanted cases).
  • Included tests for link generation and magic method (repr, str, hash) behaviors for both Site and WildcardPage classes.

@DiFronzo
DiFronzo self-requested a review June 2, 2025 10:49

@DiFronzo DiFronzo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DiFronzo
DiFronzo merged commit 910b341 into WikimediaNorge:main Jun 8, 2025
jhsoby pushed a commit that referenced this pull request Jul 21, 2025
It confirms that standard prefixes like 'en' and 'de' are properly
registered, while also validating the behavior with edge cases such as
an empty string (''), None, capitalized forms like 'UPPERcase', and
prefixes with leading/trailing whitespace like ' en '. The tests also
verify that the class remains working when unknown or invalid prefixes
(like 'zz', 'not_in_map', or the integer 42) are passed and they are not
added to the interwikimap.

<!--
This PR fixes the Issue
-->

- [x] 🍕 Feature
- [x] ✅ Test

Fixes #79

- [x] 👍 yes

- [ ] 📜 README.md
- [ ] 📖 own file under the docs folder
- [x] 🙅 no documentation needed

<!--
Write about changing templates or modules on-wiki in order to accomodate
changes in this PR
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FR] Make tests for site.py

3 participants