示例#1
0
 def test_get_base_attributes_returns_only_intended_attributes(self):
     entity = Post()
     attrs = get_base_attributes(entity).keys()
     assert set(attrs) == {
         "created_at",
         "guid",
         "handle",
         "location",
         "provider_display_name",
         "public",
         "raw_content",
         "signature",
     }
     entity = Profile()
     attrs = get_base_attributes(entity).keys()
     assert set(attrs) == {
         "created_at",
         "guid",
         "handle",
         "name",
         "email",
         "gender",
         "raw_content",
         "location",
         "public",
         "nsfw",
         "public_key",
         "image_urls",
         "tag_list",
         "signature",
     }
示例#2
0
 def test_get_base_attributes_returns_only_intended_attributes(self):
     entity = Post()
     attrs = get_base_attributes(entity).keys()
     assert set(attrs) == {
         'created_at', 'guid', 'handle', 'location', 'photos',
         'provider_display_name', 'public', 'raw_content'
     }
示例#3
0
 def from_base(cls, entity):
     return cls(**get_base_attributes(entity))
示例#4
0
 def from_base(cls, entity):
     return cls(**get_base_attributes(entity))
示例#5
0
 def test_get_base_attributes_returns_only_intended_attributes(self):
     entity = Post()
     attrs = get_base_attributes(entity).keys()
     assert set(attrs) == {
         'created_at', 'guid', 'handle', 'location', 'photos', 'provider_display_name', 'public', 'raw_content'
     }