コード例 #1
0
ファイル: contexts.py プロジェクト: tomhogans/pagerdutyapi
 def test_serializing_minimal_image(self):
     """
     Check if image with minimal properties will serialize properly
     """
     expected = {
         'src': 'http://www.example.com',
     }
     image = Image(**expected)
     expected['type'] = 'image'
     self.assertEqual(expected, image.to_dict())
コード例 #2
0
ファイル: contexts.py プロジェクト: tomhogans/pagerdutyapi
 def test_serializing_maximum_image(self):
     """
     Check if image with maximum properties will serialize properly
     """
     expected = {
         'alt': 'This is image',
         'href': 'http://www.example.com/href',
         'src': 'http://www.example.com',
     }
     image = Image(**expected)
     expected['type'] = 'image'
     self.assertEqual(expected, image.to_dict())