added unit-test for functions in buildfiles.py#3635
Merged
alex-jansen merged 3 commits intomainfrom Sep 27, 2024
Merged
Conversation
pascalfleury
approved these changes
Sep 26, 2024
|
|
||
| class TestBuildFiles(unittest.TestCase): | ||
|
|
||
| def testProtocolSwapEmpty(self): |
Contributor
There was a problem hiding this comment.
that name now does not cover all that is done in the tests though.
Contributor
Author
There was a problem hiding this comment.
I added a header doc, it checks functionality in the relevant module/library.
| def testProtocols(self): | ||
| self.assertEqual(sorted(buildfiles.protocols()), ['http', 'https']) | ||
|
|
||
| def testArrayToStr(self): |
Contributor
There was a problem hiding this comment.
how is array2str different from str.join() ?
Contributor
Author
There was a problem hiding this comment.
I think it's the same, but I'm not 100% sure and I have seen clones around various files.
So I first want to add some tests, and then see if I can get rid of it.
| formats = ["json-ld", "turtle", "nt", "nquads", "rdf"] | ||
| extype = exportType[len("RDFExport."):] | ||
| formats = ["json-ld", "turtle", "nt", "nquads", "rdf"] | ||
| extype = exportType[len("RDFExport.") :] |
Contributor
There was a problem hiding this comment.
nit: in the [] I would not add space though.
Contributor
Author
There was a problem hiding this comment.
I'll run ruff on the file, it should fix the formatting.
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
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.
Added unit-test for functions in buildfiles.py and cleaned up some of the covered functions.