def return_as_data_struct(self): """Create a data structure from the product attributes.""" output_data = Inventory.return_as_data_struct(self) output_data['material'] = self.material output_data['size'] = self.size return output_data
def return_as_data_struct(self): """Create a data structure from the product attributes.""" output_data = Inventory.return_as_data_struct(self) output_data['brand'] = self.brand output_data['voltage'] = self.voltage return output_data
def test_inventory(self): """Test that the inventory class returns the correct dict.""" inv = Inventory(INV_CDE, INV_DSC, INV_MKT_PRC, INV_RNT_PRC) self.assertEqual( { 'product_code': INV_CDE, 'description': INV_DSC, 'market_price': INV_MKT_PRC, 'rental_price': INV_RNT_PRC }, inv.return_as_data_struct())