Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test the socket interaction by mocking the socket #172

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

gerw
Copy link
Collaborator

@gerw gerw commented Feb 26, 2024

This provides almost 100% coverage of __init__.py. I am not sure about the missing lines. Sockets are weird, in particular checking whether a socket is closed / no longer usable.

Also the struct.error is not sensible in my opinion, but this should be discussed elsewhere.

Edit: And with the tests, I found a typo :)

@gerw gerw force-pushed the test_socket_interaction branch from b840f1d to 936686f Compare February 26, 2024 21:27
Copy link

Coverage

Coverage Report
FileStmtsMissCoverMissing
luxtronik
   __init__.py1811492%42–43, 46–51, 210–212, 229–231, 246–248
   __main__.py21210%3–49
   datatypes.py275199%82
   discover.py403415%21–69
luxtronik/scripts
   dump_changes.py44440%5–85
   dump_luxtronik.py27270%5–52
TOTAL67514179% 

Tests Skipped Failures Errors Time
124 0 💤 0 ❌ 0 🔥 3.969s ⏱️

@Bouni
Copy link
Owner

Bouni commented Feb 27, 2024

Nice 😎

I was tempted to implement tests for __init__.py but failed on mocking socket.socket, good work @gerw

@Bouni Bouni merged commit d284e08 into Bouni:main Sep 20, 2024
4 checks passed
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