

def testAddLinkWithOptionalProperties(self):
    self.add_link('item', '/items/{item_id}', name='name', title='Title', type='application/hal+json', profile='/profiles/item', hreflang='en', deprecation='/deprecation/item', templated=True)
    doc = Document.from_object(self.builder.as_object(), base_uri='http://localhost')
    item_link = doc.links['item']
    self.assertEqual(item_link.url(item_id='1'), 'http://localhost/items/1')
    self.assertEqual(item_link.name, 'name')
    self.assertEqual(item_link.title, 'Title')
    self.assertEqual(item_link.type, 'application/hal+json')
    self.assertEqual(item_link.profile, '/profiles/item')
    self.assertEqual(item_link.hreflang, 'en')
    self.assertEqual(item_link.deprecation, '/deprecation/item')
    self.assertTrue(item_link.is_templated)

dataset/ETHPy150Open wharris/dougrain/test/test_builder.py LinkBuilderTestsMixin.testAddLinkWithOptionalProperties/original