def test_edge_length(): for i in range(0, 15): assert isinstance(h3.edge_length(i), float) assert isinstance(h3.edge_length(i, 'm'), float) with pytest.raises(ValueError): h3.edge_length(5, 'ft')
def test_hex_edge_length(): expected_in_km = { 0: 1107.712591000, 1: 418.676005500, 2: 158.244655800, 9: 0.174375668, 15: 0.000509713, } out = {res: h3.edge_length(res, unit='km') for res in expected_in_km} assert out == pytest.approx(expected_in_km)