diff --git a/python/grass/jupyter/tests/test_utils.py b/python/grass/jupyter/tests/test_utils.py new file mode 100644 index 00000000000..661a803d641 --- /dev/null +++ b/python/grass/jupyter/tests/test_utils.py @@ -0,0 +1,5 @@ +def test_set_target_region_exists(): + """Basic sanity test to ensure function is callable.""" + from grass.jupyter.utils import set_target_region + + assert callable(set_target_region) diff --git a/python/grass/jupyter/utils.py b/python/grass/jupyter/utils.py index 95d4a0ce4d5..3c039a4c208 100644 --- a/python/grass/jupyter/utils.py +++ b/python/grass/jupyter/utils.py @@ -357,15 +357,14 @@ def set_target_region(src_env, tgt_env): to_proj = get_location_proj_string(env=tgt_env) new_region = reproject_region(region, from_proj, to_proj) # Set region to match original region extent - gs.run_command( - "g.region", + tools = Tools(env=tgt_env) + tools.g_region( n=new_region["north"], s=new_region["south"], e=new_region["east"], w=new_region["west"], rows=new_region["rows"], cols=new_region["cols"], - env=tgt_env, )