def test_current_load_returns_the_current_number_of_resource_type_held_in_the_container(self):  # noqa
		bag = MixedCargoContainer()
		bag.set_weight_capacity(100)
		slot = bag.get_slot(Fish)
		slot['load'] = 3
		slot = bag.get_slot(Cabbage)
		slot['load'] = 5
		self.assertEqual(bag.current_load(Fish), 3)
	def test_remaining_capacity_computes_the_number_of_resource_type_that_can_still_be_held_in_the_container(self):  # noqa
		bag = MixedCargoContainer()
		bag.set_weight_capacity(100)
		slot = bag.get_slot(Fish)
		slot['load'] = 3
		slot = bag.get_slot(Cabbage)
		slot['load'] = 5
		self.assertEqual(
			bag.remaining_capacity(Wood),
			(100 - 3 * Fish.weight - 5 * Cabbage.weight) / Wood.weight)
	def test_get_current_weight_computes_the_total_weight_of_all_resource_items_in_the_container(self):  # noqa
		bag = MixedCargoContainer()
		bag.set_weight_capacity(100)
		slot = bag.get_slot(Fish)
		slot['load'] = 3
		slot = bag.get_slot(Cabbage)
		slot['load'] = 5
		self.assertEqual(
			bag.get_current_weight(),
			3 * Fish.weight + 5 * Cabbage.weight,
			)
	def test_unload_cargo_decreases_load_of_container_and_returns_all_available_cargo_up_to_the_requested_quantity(self):  # noqa
		bag = MixedCargoContainer()
		bag.set_weight_capacity(Fish.weight * 10)
		bag.get_slot(Fish)['load'] = 3
		load = bag.unload_cargo(Fish, 7)
		self.assertEqual(bag.current_load(Fish), 0)
		self.assertEqual(load, 3)
	def test_unload_cargo_decreases_load_of_container(self):
		bag = MixedCargoContainer()
		bag.set_weight_capacity(Fish.weight * 10)
		bag.get_slot(Fish)['load'] = 1
		load = bag.unload_cargo(Fish, 1)
		self.assertEqual(bag.current_load(Fish), 0)
		self.assertEqual(load, 1)
	def test_load_cargo_returns_entire_load_if_slot_is_already_at_capacity(self):  # noqa
		bag = MixedCargoContainer()
		bag.set_weight_capacity(Fish.weight * 3)
		bag.get_slot(Fish)['load'] = 3
		remains = bag.load_cargo(Fish, 7)
		self.assertEqual(bag.current_load(Fish), 3)
		self.assertEqual(remains, 7)
	def test_set_weight_capacity_raises_an_exception_if_the_requested_capacity_is_less_than_or_equal_to_the_current_weight_in_the_container(self):  # noqa
		bag = MixedCargoContainer()
		bag.set_weight_capacity(Fish.weight * 3)
		slot = bag.get_slot(Fish)
		slot['load'] = 3
		with self.assertRaises(CargoContainerException) as error_context:
			bag.set_weight_capacity(Fish.weight * 2)
		self.assertIn(
			"Capacity must be greater than or equal to the current weight",
			error_context.exception.message,
			)