Ejemplo n.º 1
0
    def should_register_converters(self):
        converter = PlainConverter()
        Converters.register("text/plain", converter)

        assert Converters.types["text/plain"] == converter
Ejemplo n.º 2
0
 def test_should_discover_a_marshaller_for_a_type(self):
     assert Converters.marshaller_for(
         "application/atom").__class__ == XmlConverter().__class__
     converter = PlainConverter()
     Converters.register("text/plain", converter)
     assert Converters.marshaller_for("text/plain") == converter
Ejemplo n.º 3
0
 def should_unmarshal(self):
     converter = PlainConverter()
     result = converter.unmarshal("Hello World")
     assert result == "Hello World"
Ejemplo n.º 4
0
 def should_unmarshal(self):
     converter = PlainConverter()
     result = converter.unmarshal("Hello World")
     assert result == "Hello World"