def test_serialize_deserialize(tide):
    """
    test to_dict function for Wind object
    create a new wind object and make sure it has same properties
    """

    c_cycle = CurrentCycleMover(curr_file, topology_file, tide=tide)
    toserial = c_cycle.serialize()
    c_cycle2 = c_cycle.deserialize(toserial)
    assert c_cycle == c_cycle2
def test_serialize_deserialize(tide):
    """
    test to_dict function for Wind object
    create a new wind object and make sure it has same properties
    """

    c_cycle = CurrentCycleMover(curr_file, topology_file, tide=tide)
    toserial = c_cycle.serialize()
    c_cycle2 = c_cycle.deserialize(toserial)
    assert c_cycle == c_cycle2
示例#3
0
def test_serialize_deserialize(tide):
    """
    test to_dict function for Wind object
    create a new wind object and make sure it has same properties
    """

    c_cycle = CurrentCycleMover(curr_file, topology_file, tide=tide)
    toserial = c_cycle.serialize('webapi')
    dict_ = c_cycle.deserialize(toserial)
    if tide:
        #assert toserial['tide'] == td.serialize(json_)
        assert 'tide' in toserial
        dict_['tide'] = tide  # no longer updating properties of nested objects
        c_cycle.update_from_dict(dict_)
        assert c_cycle.tide is tide
    else:
        c_cycle.update_from_dict(dict_)