Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
wusteven815 committed Oct 29, 2024
1 parent 0ec34a7 commit 7bf65b2
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 8 deletions.
31 changes: 28 additions & 3 deletions plugins/ui/test/deephaven/ui/test_date_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def test_convert_date_props(self):
convert_list_prop,
_convert_to_java_date,
)
from deephaven.ui.types import UNDEFINED

def verify_is_local_date(dateStr):
self.assertEqual(
Expand Down Expand Up @@ -39,30 +40,54 @@ def empty_on_change():
"unavailable_dates": [to_j_instant("2021-01-01 UTC"), "2021-01-01"],
"min_value": to_j_zdt("2021-01-01 ET"),
"max_value": to_j_local_date("2021-01-01"),
"on_change": UNDEFINED,
}

props2 = {
"value": to_j_local_date("2021-01-01"),
"default_value": to_j_zdt("2021-01-01 ET"),
"placeholder_value": to_j_instant("2021-01-01 UTC"),
"on_change": verify_is_local_date,
"unavailable_dates": None,
"unavailable_dates": UNDEFINED,
"min_value": UNDEFINED,
"max_value": UNDEFINED,
}

props3 = {
"default_value": to_j_instant("2021-01-01 UTC"),
"placeholder_value": to_j_zdt("2021-01-01 ET"),
"on_change": verify_is_instant,
"value": UNDEFINED,
"min_value": UNDEFINED,
"max_value": UNDEFINED,
}

props4 = {
"placeholder_value": to_j_zdt("2021-01-01 ET"),
"on_change": verify_is_zdt,
"value": UNDEFINED,
"default_value": UNDEFINED,
"min_value": UNDEFINED,
"max_value": UNDEFINED,
}

props5 = {"on_change": verify_is_instant}
props5 = {
"on_change": verify_is_instant,
"value": UNDEFINED,
"default_value": UNDEFINED,
"min_value": UNDEFINED,
"max_value": UNDEFINED,
"placeholder_value": UNDEFINED,
}

props6 = {"on_change": empty_on_change}
props6 = {
"on_change": empty_on_change,
"value": UNDEFINED,
"default_value": UNDEFINED,
"min_value": UNDEFINED,
"max_value": UNDEFINED,
"placeholder_value": UNDEFINED,
}

_convert_date_field_props(props1)
props1["unavailable_dates"] = convert_list_prop(
Expand Down
30 changes: 27 additions & 3 deletions plugins/ui/test/deephaven/ui/test_date_picker.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def test_convert_date_props(self):
convert_list_prop,
_convert_to_java_date,
)
from deephaven.ui.types import UNDEFINED

def verify_is_local_date(dateStr):
self.assertEqual(
Expand Down Expand Up @@ -46,23 +47,46 @@ def empty_on_change():
"default_value": to_j_zdt("2021-01-01 ET"),
"placeholder_value": to_j_instant("2021-01-01 UTC"),
"on_change": verify_is_local_date,
"unavailable_dates": None,
"unavailable_dates": UNDEFINED,
"min_value": UNDEFINED,
"max_value": UNDEFINED,
}

props3 = {
"default_value": to_j_instant("2021-01-01 UTC"),
"placeholder_value": to_j_zdt("2021-01-01 ET"),
"on_change": verify_is_instant,
"value": UNDEFINED,
"min_value": UNDEFINED,
"max_value": UNDEFINED,
}

props4 = {
"placeholder_value": to_j_zdt("2021-01-01 ET"),
"on_change": verify_is_zdt,
"value": UNDEFINED,
"default_value": UNDEFINED,
"min_value": UNDEFINED,
"max_value": UNDEFINED,
}

props5 = {"on_change": verify_is_instant}
props5 = {
"on_change": verify_is_instant,
"value": UNDEFINED,
"default_value": UNDEFINED,
"min_value": UNDEFINED,
"max_value": UNDEFINED,
"placeholder_value": UNDEFINED,
}

props6 = {"on_change": empty_on_change}
props6 = {
"on_change": empty_on_change,
"value": UNDEFINED,
"default_value": UNDEFINED,
"min_value": UNDEFINED,
"max_value": UNDEFINED,
"placeholder_value": UNDEFINED,
}

_convert_date_picker_props(props1)
props1["unavailable_dates"] = convert_list_prop(
Expand Down
29 changes: 27 additions & 2 deletions plugins/ui/test/deephaven/ui/test_time_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def test_convert_time_props(self):
get_jclass_name,
_convert_to_java_time,
)
from deephaven.ui.types import UNDEFINED

def verify_is_local_time(timeStr):
self.assertEqual(
Expand All @@ -37,29 +38,53 @@ def empty_on_change():
"default_value": "10:30:45",
"min_value": to_j_zdt("2021-01-01T10:30:45 ET"),
"max_value": to_j_local_time("10:30:45"),
"on_change": UNDEFINED,
}

props2 = {
"value": to_j_local_time("10:30:45"),
"default_value": to_j_zdt("2021-01-01T10:30:45 ET"),
"placeholder_value": to_j_instant("2021-01-01T10:30:45 UTC"),
"on_change": verify_is_local_time,
"min_value": UNDEFINED,
"max_value": UNDEFINED,
}

props3 = {
"default_value": to_j_instant("2021-01-01T10:30:45 UTC"),
"placeholder_value": to_j_zdt("2021-01-01T10:30:45 ET"),
"on_change": verify_is_instant,
"value": UNDEFINED,
"min_value": UNDEFINED,
"max_value": UNDEFINED,
}

props4 = {
"placeholder_value": to_j_zdt("2021-01-01T10:30:45 ET"),
"on_change": verify_is_zdt,
"value": UNDEFINED,
"default_value": UNDEFINED,
"min_value": UNDEFINED,
"max_value": UNDEFINED,
}

props5 = {"on_change": verify_is_local_time}
props5 = {
"on_change": verify_is_instant,
"value": UNDEFINED,
"default_value": UNDEFINED,
"min_value": UNDEFINED,
"max_value": UNDEFINED,
"placeholder_value": UNDEFINED,
}

props6 = {"on_change": empty_on_change}
props6 = {
"on_change": empty_on_change,
"value": UNDEFINED,
"default_value": UNDEFINED,
"min_value": UNDEFINED,
"max_value": UNDEFINED,
"placeholder_value": UNDEFINED,
}

_convert_time_field_props(props3)
_convert_time_field_props(props4)
Expand Down

0 comments on commit 7bf65b2

Please sign in to comment.