def test_normal(self, value, type_hint, is_strict, expected_data, expected_str): dp = DataProperty( value, type_hint=type_hint, strict_level_map=get_strict_level_map(is_strict) ) assert dp.data == expected_data assert dp.to_str() == expected_str
def test_normal(self, value, type_hint, is_strict, expected_data, expected_str): dp = DataProperty(value, type_hint=type_hint, strict_level_map=get_strict_level_map(is_strict)) assert dp.data == expected_data assert dp.to_str() == expected_str
def serialize_dp(dp: DataProperty) -> Any: if dp.typecode in (Typecode.REAL_NUMBER, Typecode.INFINITY, Typecode.NAN) and isinstance( dp.data, Decimal ): return float(dp.data) if dp.typecode == Typecode.DATETIME: return dp.to_str() return dp.data
def test_normal_format_str(self, value, format_flags, expected): dp = DataProperty(value, format_flags=format_flags) assert dp.to_str() == expected
def _to_row_item(self, row_idx: int, col_dp: ColumnDataProperty, value_dp: DataProperty) -> str: return value_dp.to_str()
def test_normal_format_str(self, value, format_flags, expected): dp = DataProperty(value, format_flags=format_flags) assert dp.to_str() == expected