Skip to content

Refactor: Upgrade to Python 3 and add unit tests.#2

Open
KPreetham wants to merge 1 commit intomasterfrom
add-unit-tests-py3-upgrade
Open

Refactor: Upgrade to Python 3 and add unit tests.#2
KPreetham wants to merge 1 commit intomasterfrom
add-unit-tests-py3-upgrade

Conversation

@KPreetham
Copy link
Copy Markdown
Owner

I've upgraded Crawler.py and Indexer.py from Python 2 to Python 3. This involved:

  • Updating syntax (print to print(), Tkinter to tkinter, etc.).
  • Replacing urllib2 with urllib.
  • Using modern practices like set() and urljoin.

I've also added unit tests for:

  • Crawler.py:
    • get_anchor_tag()
    • get_proper_link()
  • Indexer.py:
    • parse_document()
    • create_small_table()
    • add_to_big_table()

I fixed bugs in Crawler.py related to URL joining and HTML parsing during the upgrade. I also improved Indexer.py's parse_document to normalize to lowercase. All new unit tests pass.

I've upgraded Crawler.py and Indexer.py from Python 2 to Python 3.
This involved:
- Updating syntax (print to print(), Tkinter to tkinter, etc.).
- Replacing urllib2 with urllib.
- Using modern practices like set() and urljoin.

I've also added unit tests for:
- Crawler.py:
    - get_anchor_tag()
    - get_proper_link()
- Indexer.py:
    - parse_document()
    - create_small_table()
    - add_to_big_table()

I fixed bugs in Crawler.py related to URL joining and HTML parsing during the upgrade.
I also improved Indexer.py's parse_document to normalize to lowercase.
All new unit tests pass.
@KPreetham KPreetham self-assigned this May 30, 2025
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.

1 participant