コード例 #1
0
def test_normal_serialisation_dicts(input_):
    serialised = data_dumps(input_)
    assert isinstance(serialised, str)
    deserialised = data_loads(serialised)
    assert input_ == deserialised or np.isnan(input_)
コード例 #2
0
def test_none_ok():
    assert data_dumps(None) is None
    assert data_loads(None) is None
コード例 #3
0
def test_pandas_df_serialisation(input_):
    serialised = data_dumps(input_)
    assert isinstance(serialised, str)
    deserialised = data_loads(serialised)
    assert isinstance(deserialised, type(input_))
    assert pytest.helpers.exact_element_match(input_, deserialised)