Currently, we get the category of an inventory item by doing:
map(type, inventory_items)
This is ok, but it is hard to create mocks for testing since python doesn't let you mock out the results of type(). I think we should use the shop_name attribute all components have to categorize.
The ramifications are:
The map should become a list comprehension
The tests for inventory will break.
The second part of this fix should be in the commandline method for displaying the inventory summary. It should output the items in the following format:
> inv -v
2 x ray-gun
1 x some-thing
3 x some-other-thing
Currently, we get the category of an inventory item by doing:
This is ok, but it is hard to create mocks for testing since python doesn't let you mock out the results of
type()
. I think we should use theshop_name
attribute all components have to categorize.The ramifications are:
map
should become a list comprehensionThe second part of this fix should be in the commandline method for displaying the inventory summary. It should output the items in the following format: