def test_hex_area(): for i in range(0, 15): assert isinstance(h3.hex_area(i), float) assert isinstance(h3.hex_area(i, 'm^2'), float) with pytest.raises(ValueError): h3.hex_area(5, 'ft^2')
def test_hex_area(): expected_in_km2 = { 0: 4250546.848, 1: 607220.9782, 2: 86745.85403, 9: 0.1053325, 15: 9e-07, } out = {k: h3.hex_area(k, unit='km^2') for k in expected_in_km2} assert out == pytest.approx(expected_in_km2)