objectdict
Project description
使用方法
import json
from unittest import TestCase
from objectdict import ObjectDict
class TestObjectDict(TestCase):
def test_value(self):
class SimpleObjectDict(ObjectDict):
int_field: int = 1
str_field = 'a'
dict_field = {}
int2_f: int
_protect = 'protect'
@classmethod
def classmethod(cls):
pass
@property
def proty(cls):
return 'property'
def asd(self):
return 'asd'
self.assertEqual(ObjectDict(), {})
self.assertEqual(SimpleObjectDict().int_field, 1)
self.assertEqual(SimpleObjectDict().str_field, 'a')
self.assertEqual(SimpleObjectDict().dict_field, {})
self.assertEqual(SimpleObjectDict(), SimpleObjectDict().from_json(json.dumps(SimpleObjectDict())))
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
objectdict-0.0.8.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for objectdict-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 674cc55715fab7cbc5a64bc62a7ff4488b621da5e7ede8564acfb3c84c4f48e5 |
|
MD5 | 4f0125454375f2f3a7731ebb2e8a34be |
|
BLAKE2b-256 | 9ca1c2339637ae702147fa5d7908136a1d8bee206c426cf908b690b8de3655cd |