You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
527 B
14 lines
527 B
def test_cleanup_data_columns(): |
|
from pandas import DataFrame |
|
from sensospot_parser.columns import _cleanup_data_columns |
|
|
|
columns = ["Rect.", "Contour", " ID ", "Found", "Dia."] |
|
data = {col: [i] for i, col in enumerate(columns)} |
|
data_frame = DataFrame(data=data) |
|
|
|
result = _cleanup_data_columns(data_frame) |
|
|
|
assert set(result.columns) == {"Pos.Id", "Spot.Found", "Spot.Diameter"} |
|
assert result["Pos.Id"][0] == 2 |
|
assert result["Spot.Found"][0] == 3 |
|
assert result["Spot.Diameter"][0] == 4
|
|
|