Exemplo n.º 1
0
 def test_item_info(self):
     f_inventory={}
     text_trap = io.StringIO()
     sys.stdout = text_trap
     user_input=["1"]
     with patch('builtins.input', side_effect=user_input):
         check_f_inventory=item_info(f_inventory)
     self.assertEqual(f_inventory,check_f_inventory)  
Exemplo n.º 2
0
 def item_info(self,f_inventory):
     f_inventory={}
     text_trap = io.StringIO()
     sys.stdout = text_trap
     user_input=["1"]
     with patch('builtins.input', side_effect=user_input):
         f_inventory=item_info(f_inventory)
     return f_inventory 
Exemplo n.º 3
0
 def test_main_menu(self):
     f_inventory={}
     user_input = ["1"]
     text_trap = io.StringIO()
     sys.stdout = text_trap
     with patch('builtins.input', side_effect=user_input):
         function = main_menu()
     if function.__name__=="add_new_item":
         f_inventory=self.add_new_item_furniture(f_inventory)
     user_input = ["2"]
     with patch('builtins.input', side_effect=user_input):
         function = main_menu()
     if function.__name__=="item_info":
         f_inventory=item_info(f_inventory)
     user_input = ["q"]
     with patch('builtins.input', side_effect=user_input):
         function = main_menu()
     if function.__name__=="exit_program":
         self.assertRaises(SystemExit, exit_program, f_inventory)