|
1 | | -from pathlib import Path |
| 1 | +# from pathlib import Path |
2 | 2 |
|
3 | | -import geopandas as gpd |
4 | | -import pytest |
| 3 | +# import geopandas as gpd |
| 4 | +# import pytest |
5 | 5 |
|
6 | | -from eis_toolkit.conversions.csv_to_geodataframe import csv_to_geodataframe |
7 | | -from eis_toolkit.exceptions import ( |
8 | | - InvalidColumnIndexException, |
9 | | - InvalidParameterValueException, |
10 | | - InvalidWktFormatException, |
11 | | -) |
| 6 | +# from eis_toolkit.conversions.csv_to_geodataframe import csv_to_geodataframe |
| 7 | +# from eis_toolkit.exceptions import ( |
| 8 | +# InvalidColumnIndexException, |
| 9 | +# InvalidParameterValueException, |
| 10 | +# InvalidWktFormatException, |
| 11 | +# ) |
12 | 12 |
|
13 | | -test_dir = Path(__file__).parent.parent |
14 | | -csv_path = test_dir.joinpath("data/remote/test.csv") |
| 13 | +# test_dir = Path(__file__).parent.parent |
| 14 | +# csv_path = test_dir.joinpath("data/remote/test.csv") |
15 | 15 |
|
16 | 16 |
|
17 | | -def test_csv_to_geodataframe(): |
18 | | - """Test csv to geopandas conversion using WKT format.""" |
19 | | - indexes = [2] |
20 | | - target_EPSG = 4326 |
21 | | - gdf = csv_to_geodataframe(csv_path, indexes, target_EPSG) |
22 | | - assert isinstance(gdf, gpd.GeoDataFrame) |
23 | | - assert gdf.crs.to_epsg() == target_EPSG |
| 17 | +# def test_csv_to_geodataframe(): |
| 18 | +# """Test csv to geopandas conversion using WKT format.""" |
| 19 | +# indexes = [2] |
| 20 | +# target_EPSG = 4326 |
| 21 | +# gdf = csv_to_geodataframe(csv_path, indexes, target_EPSG) |
| 22 | +# assert isinstance(gdf, gpd.GeoDataFrame) |
| 23 | +# assert gdf.crs.to_epsg() == target_EPSG |
24 | 24 |
|
25 | 25 |
|
26 | | -def test_csv_to_geodataframe_using_wkt_invalid_parameter_value(): |
27 | | - """Test that index out of range raises correct exception.""" |
28 | | - with pytest.raises(InvalidColumnIndexException): |
29 | | - indexes = [8] |
30 | | - target_EPSG = 4326 |
31 | | - csv_to_geodataframe(csv_path, indexes, target_EPSG) |
| 26 | +# def test_csv_to_geodataframe_using_wkt_invalid_parameter_value(): |
| 27 | +# """Test that index out of range raises correct exception.""" |
| 28 | +# with pytest.raises(InvalidColumnIndexException): |
| 29 | +# indexes = [8] |
| 30 | +# target_EPSG = 4326 |
| 31 | +# csv_to_geodataframe(csv_path, indexes, target_EPSG) |
32 | 32 |
|
33 | 33 |
|
34 | | -def test_csv_to_geodataframe_invalid_wkt(): |
35 | | - """Test that invalid WKT format raises correct exception.""" |
36 | | - with pytest.raises(InvalidWktFormatException): |
37 | | - indexes = [3] |
38 | | - target_EPSG = 4326 |
39 | | - csv_to_geodataframe(csv_path, indexes, target_EPSG) |
| 34 | +# def test_csv_to_geodataframe_invalid_wkt(): |
| 35 | +# """Test that invalid WKT format raises correct exception.""" |
| 36 | +# with pytest.raises(InvalidWktFormatException): |
| 37 | +# indexes = [3] |
| 38 | +# target_EPSG = 4326 |
| 39 | +# csv_to_geodataframe(csv_path, indexes, target_EPSG) |
40 | 40 |
|
41 | 41 |
|
42 | | -def test_csv_to_geodataframe_points(): |
43 | | - """Test csv with point features to geopandas conversion using latitude and longitude.""" |
44 | | - indexes = [5, 6] |
45 | | - target_EPSG = 4326 |
46 | | - gdf = csv_to_geodataframe(csv_path, indexes, target_EPSG) |
47 | | - assert isinstance(gdf, gpd.GeoDataFrame) |
48 | | - assert gdf.crs.to_epsg() == target_EPSG |
| 42 | +# def test_csv_to_geodataframe_points(): |
| 43 | +# """Test csv with point features to geopandas conversion using latitude and longitude.""" |
| 44 | +# indexes = [5, 6] |
| 45 | +# target_EPSG = 4326 |
| 46 | +# gdf = csv_to_geodataframe(csv_path, indexes, target_EPSG) |
| 47 | +# assert isinstance(gdf, gpd.GeoDataFrame) |
| 48 | +# assert gdf.crs.to_epsg() == target_EPSG |
49 | 49 |
|
50 | 50 |
|
51 | | -def csv_to_geodataframe_invalid_parameter_value(): |
52 | | - """Test that index(es) out of range raises correct exception.""" |
53 | | - with pytest.raises(InvalidColumnIndexException): |
54 | | - indexes = [9, 8] |
55 | | - target_EPSG = 4326 |
56 | | - csv_to_geodataframe(csv_path, indexes, target_EPSG) |
| 51 | +# def csv_to_geodataframe_invalid_parameter_value(): |
| 52 | +# """Test that index(es) out of range raises correct exception.""" |
| 53 | +# with pytest.raises(InvalidColumnIndexException): |
| 54 | +# indexes = [9, 8] |
| 55 | +# target_EPSG = 4326 |
| 56 | +# csv_to_geodataframe(csv_path, indexes, target_EPSG) |
57 | 57 |
|
58 | 58 |
|
59 | | -def csv_to_geodataframe_points_invalid_coordinate_values(): |
60 | | - """Test that index(es) with invalid coordinate value(s) raises correct exception.""" |
61 | | - with pytest.raises(InvalidParameterValueException): |
62 | | - indexes = [3, 4] |
63 | | - target_EPSG = 4326 |
64 | | - csv_to_geodataframe(csv_path, indexes, target_EPSG) |
| 59 | +# def csv_to_geodataframe_points_invalid_coordinate_values(): |
| 60 | +# """Test that index(es) with invalid coordinate value(s) raises correct exception.""" |
| 61 | +# with pytest.raises(InvalidParameterValueException): |
| 62 | +# indexes = [3, 4] |
| 63 | +# target_EPSG = 4326 |
| 64 | +# csv_to_geodataframe(csv_path, indexes, target_EPSG) |
0 commit comments