Skip to content

Refactor osmapi to be more pythonic#189

Merged
metaodi merged 20 commits into
developfrom
claude/refactor-to-pythonic-style
Feb 18, 2026
Merged

Refactor osmapi to be more pythonic#189
metaodi merged 20 commits into
developfrom
claude/refactor-to-pythonic-style

Conversation

@Claude
Copy link
Copy Markdown
Contributor

@Claude Claude AI commented Feb 17, 2026

No description provided.

Co-authored-by: metaodi <538415+metaodi@users.noreply.github.com>
@Claude Claude AI changed the title [WIP] Refactor library for more pythonic style and structure Refactor to pythonic snake_case API with backward compatibility Feb 17, 2026
@Claude Claude AI requested a review from metaodi February 17, 2026 22:07
@metaodi
Copy link
Copy Markdown
Owner

metaodi commented Feb 17, 2026

@claude[agent] the build fails, can you check why and fix it?

Co-authored-by: metaodi <538415+metaodi@users.noreply.github.com>
@Claude Claude AI changed the title Refactor to pythonic snake_case API with backward compatibility Addressing PR comments Feb 17, 2026
@metaodi
Copy link
Copy Markdown
Owner

metaodi commented Feb 17, 2026

@claude[agent] now there is a black error. Is there a version difference between different versions of black? Maybe pin black to a version that works for Python 3.9 and 3.11 as well.

@metaodi metaodi changed the title Addressing PR comments Refactor osmapi to be more pythonic Feb 17, 2026
Co-authored-by: metaodi <538415+metaodi@users.noreply.github.com>
@Claude
Copy link
Copy Markdown
Contributor Author

Claude AI commented Feb 17, 2026

@claude[agent] now there is a black error. Is there a version difference between different versions of black? Maybe pin black to a version that works for Python 3.9 and 3.11 as well.

Fixed in 5f66e91. Pinned black to version 24.8.0 for consistent formatting across Python 3.9-3.11, and simplified f-string formatting in capabilities.py and note.py.

@Claude Claude AI changed the title Refactor osmapi to be more pythonic Addressing PR comments Feb 17, 2026
@metaodi metaodi changed the title Addressing PR comments Refactor osmapi to be more pythonic Feb 17, 2026
@metaodi
Copy link
Copy Markdown
Owner

metaodi commented Feb 18, 2026

@claude[agent] the tests fail, something doesn't work with the mocks, can you check and fix the issue in a new PR?

@Claude
Copy link
Copy Markdown
Contributor Author

Claude AI commented Feb 18, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: `/usr/bin/gh gh pr create --title Fix mock content initialization in test fixtures --body ## Summary

This PR fixes test failures caused by mock objects being passed to XML parsing functions after the snake_case refactoring in PR #189.

Problem

After refactoring test method names to snake_case, many tests failed with TypeError: a bytes-li k/_temp/ghcca-node/node/bin/git (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@Claude Claude AI changed the title Refactor osmapi to be more pythonic Addressing PR comments Feb 18, 2026
@metaodi metaodi changed the title Addressing PR comments Refactor osmapi to be more pythonic Feb 18, 2026
@metaodi
Copy link
Copy Markdown
Owner

metaodi commented Feb 18, 2026

@claude[agent] why do the tests fail during the build? It works locally on my machine. Am I missing something?

@Claude
Copy link
Copy Markdown
Contributor Author

Claude AI commented Feb 18, 2026

@claude[agent] why do the tests fail during the build? It works locally on my machine. Am I missing something?

The tests fail in CI because some fixture files weren't fully renamed to snake_case. The test methods are now test_capabilities, test_changeset_create, etc., but the fixture files are still test_Capabilities.xml, test_Changeset_create.xml, etc.

When tests can't find their fixture files, they use a default mock response that isn't valid XML, causing XmlResponseInvalidError. I'll rename these files to match the snake_case test method names.

Complete the snake_case refactoring by renaming the last 5 fixture files that were still using CamelCase. This fixes test failures in CI where tests couldn't find their fixture files and fell back to invalid mock XML responses.

Files renamed:
- test_Capabilities.xml → test_capabilities.xml
- test_Changeset_create.xml → test_changeset_create.xml
- test_Changeset_create_node.xml → test_changeset_create_node.xml
- test_Changeset_download_containing_unicode.xml → test_changeset_download_containing_unicode.xml
- test_Changeset_upload.xml → test_changeset_upload.xml

All 147 tests now pass. Test coverage improved from 87% to 90%.

Co-authored-by: metaodi <538415+metaodi@users.noreply.github.com>
@Claude Claude AI changed the title Refactor osmapi to be more pythonic Addressing PR comments Feb 18, 2026
@metaodi metaodi marked this pull request as ready for review February 18, 2026 16:04
@metaodi metaodi changed the title Addressing PR comments Refactor osmapi to be more pythonic Feb 18, 2026
@metaodi metaodi merged commit ee69407 into develop Feb 18, 2026
4 checks passed
@metaodi metaodi deleted the claude/refactor-to-pythonic-style branch February 18, 2026 20:05
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.

2 participants