def test_serialize_to_plist(): output = anyserializer.serialize("plist", a_dict) assert expected_plist.strip() in output.strip()
def test_serialize_to_unknown_format(): with pytest.raises(KeyError): output = anyserializer.serialize("foobar", a_dict)
def test_serialize_to_phpserialize(): output = anyserializer.serialize("phpserialize", a_dict) assert output.strip() == expected_phpserialize.strip()
def test_serialize_to_pickle(): output = anyserializer.serialize("pickle", a_dict) b_dict = pickle.loads(output) assert a_dict == b_dict
def test_serialize_to_pprint(): output = anyserializer.serialize("pprint", a_dict) assert output.strip() == expected_pprint.strip()
def test_serialize_to_yaml(): output = anyserializer.serialize("yaml", a_dict) assert output.strip() == expected_yaml.strip()
def test_serialize_to_json(): output = anyserializer.serialize("json", a_dict) assert output.strip() == expected_json.strip()