Skip to content

Commit

Permalink
Add the first test
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Jan 31, 2023
1 parent 1e8de17 commit 79460fb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pygmt/tests/baseline/test_timestamp.png.dvc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
outs:
- md5: 885766da8a23cdad2a4cfd96fcda9ea0
size: 1759
path: test_timestamp.png
21 changes: 21 additions & 0 deletions pygmt/tests/test_timestamp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""
Tests for Figure.timestamp.
"""
import pytest
from pygmt import Figure


@pytest.fixture(scope="module", name="faketime")
def fixture_faketime():
"""
Fake datetime passed to the "timefmt" parameter so that the timestamp is
fixed.
"""
return "1970-01-01T00:00:00"


@pytest.mark.mpl_image_compare
def test_timestamp(faketime):
fig = Figure()
fig.timestamp(timefmt=faketime)
return fig

0 comments on commit 79460fb

Please sign in to comment.