Skip to content

Commit

Permalink
Migrate test_figure_shift_origin to dvc (#1133)
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman authored Mar 30, 2021
1 parent c280711 commit 6ef9512
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
4 changes: 4 additions & 0 deletions pygmt/tests/baseline/test_figure_shift_origin.png.dvc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
outs:
- md5: 07df92baab0051531f6c8023f4108332
size: 9876
path: test_figure_shift_origin.png
Binary file removed pygmt/tests/baseline/test_shift_origin.png
Binary file not shown.
21 changes: 11 additions & 10 deletions pygmt/tests/test_figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,21 +147,22 @@ def test_figure_show():


@pytest.mark.mpl_image_compare
def test_shift_origin():
def test_figure_shift_origin():
"""
Test if fig.shift_origin works.
"""
kwargs = dict(region=[0, 3, 0, 5], projection="X3c/5c", frame=0)
fig = Figure()
# First call shift_origin without projection and region.
# Test the issue https://github.com/GenericMappingTools/pygmt/issues/514
fig.shift_origin(xshift="2i", yshift="3i")
fig.basemap(region="10/70/-300/300", projection="X3i/5i", frame="af")
fig.shift_origin(xshift="4i")
fig.basemap(region="10/70/-300/300", projection="X3i/5i", frame="af")
fig.shift_origin(yshift="6i")
fig.basemap(region="10/70/-300/300", projection="X3i/5i", frame="af")
fig.shift_origin(xshift="-4i", yshift="6i")
fig.basemap(region="10/70/-300/300", projection="X3i/5i", frame="af")
# Test issue https://github.com/GenericMappingTools/pygmt/issues/514
fig.shift_origin(xshift="2c", yshift="3c")
fig.basemap(**kwargs)
fig.shift_origin(xshift="4c")
fig.basemap(**kwargs)
fig.shift_origin(yshift="6c")
fig.basemap(**kwargs)
fig.shift_origin(xshift="-4c", yshift="6c")
fig.basemap(**kwargs)
return fig


Expand Down

0 comments on commit 6ef9512

Please sign in to comment.