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

Fix for issue #19 (as discussed) and added generate_xml method #21

Closed
wants to merge 5 commits into from

Conversation

ayushbindlish
Copy link

@ghandic
Copy link
Owner

ghandic commented Jan 3, 2022

Looks good, I'm currently on mobile and won't get chance to do a full review and test things out until next week sometime. Thanks for the contribution!

@ayushbindlish
Copy link
Author

Sure. Do let me know once you are able to do a full review.

@codecov-commenter
Copy link

Codecov Report

Merging #21 (0968c53) into main (c8769ce) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main       #21   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           13        13           
  Lines          383       400   +17     
=========================================
+ Hits           383       400   +17     
Impacted Files Coverage Δ
src/jsf/parser.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c8769ce...0968c53. Read the comment docs.

src/jsf/parser.py Outdated Show resolved Hide resolved
src/jsf/parser.py Outdated Show resolved Hide resolved
@@ -229,7 +231,7 @@ def test_const(TestData):
assert isinstance(f["country"], str)
assert f["country"] == "United States of America"


#@pytest.mark.xfail(reason="Always failing with "no such file or dir" error!!")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should exist if youre running the tests from a unix based machine and from the same directory as the src folder

setup.py Outdated
@@ -12,7 +12,7 @@
long_description_content_type="text/markdown",
package_dir={"": "src"},
packages=setuptools.find_packages("src", exclude=["tests"]),
install_requires=["rstr", "faker", "smart_open", "jsonschema", "typer", "pydantic"],
install_requires=["rstr", "faker", "smart_open", "jsonschema", "typer", "pydantic", "defusedxml", "requests", "json2xml"],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since XML wont be added in the package as noted below, could you remove this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not work for me for some reason.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am on ubuntu.
command used: pytest

pwd: jsf/src

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above comments are supposed to be for pytest failure I mentioned above.

@ghandic
Copy link
Owner

ghandic commented Jan 16, 2022

Hey, had time to get to look at this further, thanks again for the time put into this! I think I'd rather keep the xml part outside of the package as its purely for JSON and there would be no tests to ensure the functionality.

I've added some inline comments, looks great! Thanks for putting this PR up and fixing issues youve found!

@ayushbindlish
Copy link
Author

Hey @ghandic I have updated the generate and validate method and removed to_xml method.

@ghandic ghandic closed this Jun 30, 2022
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.

None yet

3 participants