Пример #1
0
    def test_deser(self):
        class C(ComplexModel):
            a = Unicode
            b = Decimal

        ret = get_object_as_yaml(C(a='burak', b=D(30)), C)
        assert ret == b"""C:
Пример #2
0
    def test_deser(self):
        class C(ComplexModel):
            a = Unicode
            b = Decimal

        ret = get_object_as_yaml(C(a='burak', b=D(30)), C)
        assert ret == """C:
Пример #3
0
 def do_write_config(self):
     open(self.config_file, 'wb').write(get_object_as_yaml(self,
                                           self.__class__, polymorphic=True))
Пример #4
0
 def write_config(self):
     open(self.config_file, 'wb').write(
         get_object_as_yaml(self, self.__class__, polymorphic=True))