Beispiel #1
0
 def test_prompt_user_not_yes(self):
     """Test output prompting user if they want to upload (assume yes was not specified)"""
     test_videos = {"v1", "v2", "v3"}
     expected = "Found videos:\n"
     joined = "\n".join(test_videos)
     expected += joined
     try:
         sys.stdout = self.out
         with mock.patch('__builtin__.raw_input', return_value='no'):
             youtube.prompt_user(test_videos, confirmation=False)
         output = self.out.getvalue().strip()
         self.assertEqual(expected, output)
     finally:
         sys.stdout = self.saved_stdout
Beispiel #2
0
 def test_prompt_user_not_yes(self):
     """Test output prompting user if they want to upload (assume yes was not specified)"""
     test_videos = {"v1", "v2", "v3"}
     expected = "Found videos:\n"
     joined = "\n".join(test_videos)
     expected += joined
     try:
         sys.stdout = self.out
         with mock.patch("__builtin__.raw_input", return_value="no"):
             youtube.prompt_user(test_videos, confirmation=False)
         output = self.out.getvalue().strip()
         self.assertEqual(expected, output)
     finally:
         sys.stdout = self.saved_stdout
Beispiel #3
0
 def test_prompt_user_yes(self):
     """Test assume yes (assume yes was not specified)"""
     self.assertTrue(
         youtube.prompt_user({"v1", "v2", "v3"}, confirmation=True))
Beispiel #4
0
 def test_prompt_user_yes(self):
     """Test assume yes (assume yes was not specified)"""
     self.assertTrue(youtube.prompt_user({"v1", "v2", "v3"}, confirmation=True))