-
-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* g.mapsets: fixed indenting and added json flag in preperation to add json output * Added format options to list mapsets as plain, vertical, csv, or json * g.mapsets: Added start testing listing mapsets with different formats * g.mapsets: Reformated python with flake8 and black * g.mapsets: Fixed indent conflict * Fixed implicit declaration of function errors * Fixed issues found in code review * Added print flag to json output and added tests * Simplified tests * Apply clang format suggestions Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Updated code to use parson and fixed tests * Updated docs * Fixed mapsets array initalization issue * Fixed bug setting JSON_ARRAY * Removed unused parameter * Update general/g.mapsets/main.c Fixed typo. Co-authored-by: Anna Petrasova <[email protected]> * Updated default separator to space * Update general/g.mapsets/main.c Switch GUI section to Print Co-authored-by: Anna Petrasova <[email protected]> * Update general/g.mapsets/main.c Co-authored-by: Anna Petrasova <[email protected]> * Update general/g.mapsets/main.c Co-authored-by: Anna Petrasova <[email protected]> * Removed unneeded logic * Update general/g.mapsets/list.c Co-authored-by: Nicklas Larsson <[email protected]> * Update general/g.mapsets/list.c Co-authored-by: Nicklas Larsson <[email protected]> * Implmented suggestion from code review * Removed duplicate code * Refactored duplicate code and removed some comments --------- Co-authored-by: Edouard Choinière <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Corey White <[email protected]> Co-authored-by: Anna Petrasova <[email protected]> Co-authored-by: Nicklas Larsson <[email protected]>
- Loading branch information
1 parent
49e1353
commit 8bf604c
Showing
7 changed files
with
268 additions
and
38 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"""Fixtures for Jupyter tests | ||
Fixture for grass.jupyter.TimeSeries test | ||
Fixture for ReprojectionRenderer test with simple GRASS location, raster, vector. | ||
""" | ||
|
||
|
||
from types import SimpleNamespace | ||
|
||
import grass.script as gs | ||
import pytest | ||
|
||
TEST_MAPSETS = ["PERMANENT", "test1", "test2", "test3"] | ||
ACCESSIBLE_MAPSETS = ["test3", "PERMANENT"] | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def simple_dataset(tmp_path_factory): | ||
"""Start a session and create a test mapsets | ||
Returns object with attributes about the dataset. | ||
""" | ||
tmp_path = tmp_path_factory.mktemp("simple_dataset") | ||
location = "test" | ||
gs.core._create_location_xy(tmp_path, location) # pylint: disable=protected-access | ||
with gs.setup.init(tmp_path / location): | ||
gs.run_command("g.proj", flags="c", epsg=26917) | ||
gs.run_command("g.region", s=0, n=80, w=0, e=120, b=0, t=50, res=10, res3=10) | ||
# Create Mock Mapsets | ||
for mapset in TEST_MAPSETS: | ||
gs.run_command("g.mapset", location=location, mapset=mapset, flags="c") | ||
|
||
yield SimpleNamespace( | ||
mapsets=TEST_MAPSETS, accessible_mapsets=ACCESSIBLE_MAPSETS | ||
) |
Oops, something went wrong.