Пример #1
0
 def test_default_output(self):
     audio = Audio(['-l', 'https:\\link.com'])
     audio._Audio__parse_arguments()
     self.assertEqual(
         audio.output,
         os.path.join(os.path.join(os.getcwd(), 'Unknown'),
                      "%(title)s.%(ext)s"))
Пример #2
0
 def test_only_folder_help(self):
     with captured_output() as (out, err):
         with mock_mkdir():
             Audio(['-f', 'The Cows'])._Audio__parse_arguments()
     output = out.getvalue().strip()
     self.assert_usage(output)
Пример #3
0
 def test_folder_name(self):
     with mock_mkdir():
         audio = Audio(['-f', 'The Cows'])
         audio._Audio__parse_arguments()
     self.assertEqual(audio.folder, os.path.join(os.getcwd(), 'The Cows'))
Пример #4
0
 def test_only_folder(self):
     with mock_mkdir():
         self.assertFalse(
             Audio(['-f', 'The Cows'])._Audio__parse_arguments())
Пример #5
0
 def test_only_output_help(self):
     with captured_output() as (out, err):
         Audio(['-o', 'output.bla'])._Audio__parse_arguments()
     output = out.getvalue().strip()
     self.assert_usage(output)
Пример #6
0
 def test_output_name(self):
     audio = Audio(['-o', 'output.wha'])
     audio._Audio__parse_arguments()
     self.assertEqual(audio.output, 'output.wha')
Пример #7
0
 def test_only_output(self):
     self.assertFalse(Audio(['-o', 'output.kra'])._Audio__parse_arguments())
Пример #8
0
 def test_multiple_link_names(self):
     audio = Audio(['-l', 'http:\\link.com,http:\\otherlink.com'])
     audio._Audio__parse_arguments()
     self.assertEqual(audio.links,
                      ['http:\\link.com', 'http:\\otherlink.com'])
Пример #9
0
 def test_only_link_argument_name(self):
     audio = Audio(['-l', 'http:\\link.com'])
     audio._Audio__parse_arguments()
     self.assertEqual(audio.links, ['http:\\link.com'])
Пример #10
0
 def test_only_link_argument(self):
     self.assertTrue(
         Audio(['-l', 'http:\\link.com'])._Audio__parse_arguments())
Пример #11
0
 def test_no_arguments(self):
     self.assertFalse(Audio('')._Audio__parse_arguments())
Пример #12
0
 def test_default_folder(self):
     audio = Audio(['-l', 'https:\\link.com'])
     audio._Audio__parse_arguments()
     self.assertEqual(audio.folder, os.path.join(os.getcwd(), 'Unknown'))