



import unittest

from knapsack import greedy_knapsack as kp



class 						UpperCAmelCase_					( unittest.TestCase):







							def      snake_case__   (     self):

														'''simple docstring'''

														_lowerCAmelCase  :							Dict				     =					[10, 20, 30, 40, 50, 60]
														_lowerCAmelCase  :							Dict				     =					[2, 4, 6, 8, 10, 12]
														_lowerCAmelCase  :							List[str]				     =					100
														self.assertEqual(kp.calc_profit(__a,    __a,    __a),    210)







							def      snake_case__   (     self):

														'''simple docstring'''

														self.assertRaisesRegex(__a,    "max_weight must greater than zero.")







							def      snake_case__   (     self):

														'''simple docstring'''

														self.assertRaisesRegex(__a,    "Weight can not be negative.")







							def      snake_case__   (     self):

														'''simple docstring'''

														self.assertRaisesRegex(__a,    "Profit can not be negative.")







							def      snake_case__   (     self):

														'''simple docstring'''

														self.assertRaisesRegex(__a,    "max_weight must greater than zero.")







							def      snake_case__   (     self):

														'''simple docstring'''

														self.assertRaisesRegex(
														    __a,    "The length of profit and weight must be same.")


if __name__ == "__main__":
			unittest.main()





from __future__ import annotations






def        A       (      _lowerCamelCase						):





							'''simple docstring'''




							if not nums:
														raise ValueError("List is empty"						)
							return sum(_lowerCamelCase						) / len(_lowerCamelCase						)


if __name__ == "__main__":
						import doctest

						doctest.testmod()
