コード例 #1
0
ファイル: test_stubs.py プロジェクト: ameily/cincoconfig
    def test_get_annotation_typestr_type_module(self):
        custom_type = type('CustomType', tuple(), {})
        custom_type.__module__ = 'a.b.c'
        field = Field(key='helo')
        field.storage_type = custom_type

        assert get_annotation_typestr(field) == 'a.b.c.CustomType'
コード例 #2
0
ファイル: test_stubs.py プロジェクト: ameily/cincoconfig
 def test_get_annotation_type_any(self):
     field = Field(key='hello')
     field.storage_type = ''
     assert get_annotation_typestr(field) == 'typing.Any'
コード例 #3
0
ファイル: test_stubs.py プロジェクト: ameily/cincoconfig
 def test_get_annotation_typestr_str(self):
     field = Field(key='hello')
     field.storage_type = 'asdf'
     assert get_annotation_typestr(field) == 'asdf'