-
-
Notifications
You must be signed in to change notification settings - Fork 337
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
v.build: added tests for v.build module #5061
base: main
Are you sure you want to change the base?
Conversation
|
||
cls.use_temp_region() | ||
gs.run_command("v.edit", map="test_3x3_map", tool="create", overwrite=True) | ||
gs.run_command("g.region", n=3, s=0, e=3, w=0, res=1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to set region for vector processing, it applies to raster operations only
"""Set up a temporary region and create vector map with test features.""" | ||
|
||
cls.use_temp_region() | ||
gs.run_command("v.edit", map="test_3x3_map", tool="create", overwrite=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use instead something like this:
gs.write_command("v.in.ascii", input="-", stdin=input_data, output=...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Embed this inside the test file, no need to have a separate file. Alternatively it would go in testsuite/data/
|
||
# Compare the dictionaries | ||
if self.build_module == self.expected_output: | ||
print("Outputs match!") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use assert methods, not prints
flags="n", | ||
overwrite=True, | ||
) | ||
# Run v.build (with multiple dump options) and store its output in a class variable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use read_command, the output is not meant to be parsed into a dictionary.
This PR introduces tests for the
v.build
module for various options includingbuild, dump, sdump, cdump, fdump
.The additional text file is used to validate the output.