Skip to content
Closed
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions tests/test_maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def test_setup_map():
'width': 960,
'height': 500,
'features': [],
'attr':'Map tiles by Stamen Design, CC BY 3.0 - Map data © OpenStreetMap'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed, please remove

}
""" Tests features as NumPy array. """
kwargs2 = {
Expand All @@ -56,6 +57,7 @@ def test_setup_map():
ds.Marker(51.514, -0.139),
ds.Marker(51.519, -0.132)
]),
'attr':'Map tiles by Stamen Design, CC BY 3.0 - Map data © OpenStreetMap'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed, please remove

}
ds.Map(**kwargs1).show()
ds.Map(**kwargs2).show()
Expand Down
20 changes: 20 additions & 0 deletions tests/test_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ def scrabble_table2():
'pointsplus1', [2, 3, 3, 11],
])

@pytest.fixture(scope='function')
def empty_table():
"""Setup empty table"""
return Table().with_columns("A",[])


def assert_equal(string1, string2):
string1, string2 = str(string1), str(string2)
Expand Down Expand Up @@ -1660,6 +1665,21 @@ def test_join_without_other_label(table, table2):
2 | c | 3 | two
""")

def test_join_with_empty_table(table, empty_table):
result = empty_table._join('points', table)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I think you're testing the right things - testing the internal methods (denoted with the underscore at the beginning) is not a standard practice. I think this could be a good PR if you did these same tests using the "join" method.

assert result is None

result = table._join('points', empty_table)
assert result is None

def test_join_without_other_label(table, table2):
result = table._join('points', table2)
assert result is not None






##################
# Export/Display #
Expand Down