move numpy based tests to xarray/zarr provider (#1042)
This commit is contained in:
@@ -29,7 +29,6 @@
|
||||
|
||||
from datetime import datetime, date, time
|
||||
from decimal import Decimal
|
||||
from numpy import float64, int64
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -88,12 +87,6 @@ def test_json_serial():
|
||||
d = Decimal(1.0)
|
||||
assert util.json_serial(d) == 1.0
|
||||
|
||||
d = int64(500_000_000_000)
|
||||
assert util.json_serial(d) == 500_000_000_000
|
||||
|
||||
d = float64(500.00000005)
|
||||
assert util.json_serial(d) == 500.00000005
|
||||
|
||||
with pytest.raises(TypeError):
|
||||
util.json_serial('foo')
|
||||
|
||||
|
||||
@@ -27,9 +27,12 @@
|
||||
#
|
||||
# =================================================================
|
||||
|
||||
from numpy import float64, int64
|
||||
|
||||
import pytest
|
||||
|
||||
from pygeoapi.provider.xarray_ import XarrayProvider
|
||||
from pygeoapi.util import json_serial
|
||||
|
||||
from .util import get_test_file_path
|
||||
|
||||
@@ -86,3 +89,11 @@ def test_query(config):
|
||||
|
||||
data = p.query(format_='zarr')
|
||||
assert isinstance(data, bytes)
|
||||
|
||||
|
||||
def test_numpy_json_serial():
|
||||
d = int64(500_000_000_000)
|
||||
assert json_serial(d) == 500_000_000_000
|
||||
|
||||
d = float64(500.00000005)
|
||||
assert json_serial(d) == 500.00000005
|
||||
|
||||
Reference in New Issue
Block a user