Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added testing to test_maps.py #607

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions tests/test_maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,3 +541,26 @@ def test_remove_nonexistent_zip_code_column():
result = maps.get_coordinates(table, replace_columns=True)
# Ensure that the "zip code" column is removed
assert 'zip code' not in result.labels

def test_map_with_no_features():
""" Tests that a map with no features does not produce errors and has no markers or regions. """
empty_map = ds.Map(features=[])
empty_map.show()
assert len(empty_map._features) == 0, "Expected no features in the map"

def test_adding_markers_to_existing_map(states):
""" Tests adding markers to an existing map and checks if they are correctly integrated. """
# Create an initial map with state regions
initial_map = states

# Create some markers
marker1 = ds.Marker(37.7749, -122.4194, label='San Francisco') # San Francisco coordinates
marker2 = ds.Marker(34.0522, -118.2437, label='Los Angeles') # Los Angeles coordinates

# Add markers to the existing map
updated_map = initial_map.overlay(marker1)
updated_map = updated_map.overlay(marker2)

# Check if the markers are correctly added
assert marker1 in updated_map._features, "San Francisco marker should be in the map"
assert marker2 in updated_map._features, "Los Angeles marker should be in the map"
Loading