forked from xenserver/python-libs
-
Notifications
You must be signed in to change notification settings - Fork 0
test Tdd py3 PR #5
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c94805c to
5b3e731
Compare
Codecov Report
@@ Coverage Diff @@
## master #5 +/- ##
=========================================
Coverage ? 67.40%
=========================================
Files ? 20
Lines ? 3454
Branches ? 0
=========================================
Hits ? 2328
Misses ? 1126
Partials ? 0 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
5b3e731 to
d2d3404
Compare
With python3, pylint complains about `else: raise()` constructs. This rework avoids them and reduces cyclomatic complexity by using the error-out-first idiom. Signed-off-by: Yann Dirson <yann.dirson@vates.fr>
This is supposed to be just a module renaming to conform to PEP8, see https://docs.python.org/3/whatsnew/3.0.html#library-changes The SafeConfigParser class has been renamed to ConfigParser in Python 3.2, and backported as addon package. The `readfp` method now triggers a deprecation warning to replace it with `read_file`. Originally authored by Yann Dirson. Co-authored-by: Yann Dirson <yann.dirson@vates.fr> Signed-off-by: Bernhard Kaindl <bernhard.kaindl@cloud.com>
xcp.xmlunwrap extracts XML Elements from XML, and for Python2, the unwrapped unicode is encoded into Py2:str(bytes). Python3 unwraps XML Text elements as the Py3:str type which is likewise Unicode, but since Py3:str is the native type, we don't want to encode the Py3:str to Py3:bytes as that would break the API for use on Python3. BEcause binary data is not legal XML content and XML Text elements are defined to be encoded text, UTF-8 is the standard encoding, which Python converts to. It this fine to only encode() to Py2:str(=bytes) on Python2 as a legacy operation which can be removed once we drop Python2. Signed-off-by: Bernhard Kaindl <bernhard.kaindl@cloud.com>
Fix issue #19 based on the description and progress from PR xenserver#24. Allows for opening text and binary files in text and binary modes. Mode, encoding and error handling can be set by passing the parameters "encoding" and "errors" using the kwargs parameters from openAddress() and writeFile() to open(mode, **kwargs) and ftp.makefile(mode, **kwargs). Signed-off-by: Bernhard Kaindl <bernhard.kaindl@cloud.com>
Add and enable a parameterized test to read binary data from a file- and an HTTP based accessor. Originally authored by Yann Dirson. Extracted, refactored and squashed for a single considated and concise commit by me. Co-authored-by: Yann Dirson <yann.dirson@vates.fr> Signed-off-by: Bernhard Kaindl <bernhard.kaindl@cloud.com>
Comment from Yann: diff-cover defaults to origin/main in new version, it seems. Originally by Yann Dirson, Updates by me: - Fix the GitHub action deprecation warning caused by the use of old action repo version which use the deprecated node.js 12 - Rename the variable "pyversion" to the upstream "python-version" - Remove the installation of pyliblzma which is not used. - Add branding.py to fix GitHub CI with Python3 Co-authored-by: Yann Dirson <yann.dirson@vates.fr> Signed-off-by: Bernhard Kaindl <bernhard.kaindl@cloud.com>
d2d3404 to
d940f90
Compare
…3.12) Because future.standard_library also has not type markers, replacing future with six.moves (which is also much shorter) also makes fixing mypy easier. Signed-off-by: Bernhard Kaindl <bernhard.kaindl@cloud.com>
Without these generated API descriptions, we'd have to disable all checks which use these APIs because we'd have to typing info for them. Signed-off-by: Bernhard Kaindl <bernhard.kaindl@cloud.com>
10014b5 to
74c2003
Compare
☂️ Python Coverage
Overall Coverage
New Files
Modified FilesNo covered modified files...
|
8364261 to
b90a671
Compare
c0d24b4 to
de11320
Compare
Signed-off-by: Bernhard Kaindl <bernhard.kaindl@cloud.com>
de11320 to
eb92036
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.