def test_define_linking_detail(self): # given: metadata = MetadataEntity() # when: metadata.define_linking_detail('product_core.name', 'Apple Juice') metadata.define_linking_detail('product_core.description', 'pasteurised fruit juice') # then: product_core = metadata.get_linking_detail('product_core') self.assertIsNotNone(product_core) self.assertEqual('Apple Juice', product_core.get('name')) self.assertEqual('pasteurised fruit juice', product_core.get('description'))
def apply(self, metadata: MetadataEntity, cell_data): value = self.converter.convert(cell_data) metadata.define_linking_detail(self.applied_field, value)