Skip to content

Commit fc69697

Browse files
committed
Implemented unit tests for bug 162.
1 parent 8a7c606 commit fc69697

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
task_id,name,start,end,parent,dependency
2+
1,DoThing1,2023-01-01,2023-02-01,,
3+
2,DoThing1-sub1,2023-01-11,2023-01-14,1,
4+
3,DoThing1-sub2,2023-01-01,2023-02-01,1,2
5+
4,DoThing2,2023-02-02,2023-03-01,,

tests/options/series/test_base.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,4 +923,27 @@ def test_convert_to(input_files, filename, target_type, as_cls, error):
923923
converted = original.convert_to(target_type)
924924
assert converted is not None
925925
assert isinstance(converted, SeriesBase)
926-
assert isinstance(converted, target_type_cls)
926+
assert isinstance(converted, target_type_cls)
927+
928+
929+
def test_bugfix162(input_files):
930+
from highcharts_core.chart import Chart
931+
from highcharts_core.options import HighchartsOptions
932+
from highcharts_core.options.series.area import LineSeries
933+
934+
import pandas as pd
935+
from collections import defaultdict
936+
937+
filename = 'series/base/bugfix162.csv'
938+
input_file = check_input_file(input_files, filename)
939+
940+
dtype = defaultdict(lambda: "str")
941+
942+
df = pd.read_csv(input_file, dtype=dtype, parse_dates=["start", "end"])
943+
944+
# Creating a Series from the DataFrame
945+
my_series = LineSeries.from_pandas(
946+
df, property_map={"id": "task_id", "name": "name", "start": "start", "end": "end"}
947+
)
948+
949+
assert my_series is not None

0 commit comments

Comments
 (0)