示例#1
0
 def test_no_recordings_folder(self):
     fetch_server = Mock()
     fetch_server.url = URL_NO_RECORDINGS
     options = fetchtv.Options([CMD_RECORDINGS])
     results = fetchtv.get_fetch_recordings(fetch_server, options)
     fetchtv.print_recordings(results)
     self.assertEqual(0, len(results))
示例#2
0
 def test_get_shows(self):
     fetch_server = Mock()
     fetch_server.url = URL_DUMMY
     options = fetchtv.Options([CMD_SHOWS])
     results = fetchtv.get_fetch_recordings(fetch_server, options)
     fetchtv.print_recordings(results)
     self.assertEqual(8, len(results))
示例#3
0
 def test_exclude_one_show(self):
     fetch_server = Mock()
     fetch_server.url = URL_DUMMY
     options = fetchtv.Options(
         [CMD_RECORDINGS, f'{OPTION_EXCLUDE}="{SHOW_ONE}"'])
     results = fetchtv.get_fetch_recordings(fetch_server, options)
     fetchtv.print_recordings(results)
     self.assertEqual(7, len(results))
示例#4
0
 def test_get_all_recordings(self):
     fetch_server = Mock()
     fetch_server.url = URL_DUMMY
     options = fetchtv.Options([CMD_RECORDINGS])
     results = fetchtv.get_fetch_recordings(fetch_server, options)
     fetchtv.print_recordings(results)
     self.assertEqual(8, len(results))
     self.assertEqual(134, len(results[4]['items']))
示例#5
0
 def test_get_two_show_recording(self):
     fetch_server = Mock()
     fetch_server.url = URL_DUMMY
     options = fetchtv.Options(
         [CMD_RECORDINGS, f'{OPTION_FOLDER}="{SHOW_ONE}, {SHOW_TWO}"'])
     results = fetchtv.get_fetch_recordings(fetch_server, options)
     fetchtv.print_recordings(results)
     self.assertEqual(3, len(
         results))  # Test data returns LEGO Masters and Lego Masters....
示例#6
0
 def test_get_one_show_recording(self):
     fetch_server = Mock()
     fetch_server.url = URL_DUMMY
     options = fetchtv.Options(
         [CMD_RECORDINGS, f'{OPTION_FOLDER}="{SHOW_ONE}"'])
     results = fetchtv.get_fetch_recordings(fetch_server, options)
     fetchtv.print_recordings(results)
     self.assertEqual(1, len(results))
     self.assertEqual(134, len(results[0]['items']))
示例#7
0
 def test_exclude_two_shows(self):
     fetch_server = Mock()
     fetch_server.url = URL_DUMMY
     options = fetchtv.Options(
         [CMD_RECORDINGS, f'{OPTION_EXCLUDE}="{SHOW_ONE}, {SHOW_TWO}"'])
     results = fetchtv.get_fetch_recordings(fetch_server, options)
     fetchtv.print_recordings(results)
     self.assertEqual(
         5, len(results)
     )  # Test data has LEGO Masters and Lego Masters - both are matched
示例#8
0
 def test_get_two_recording_item(self):
     fetch_server = Mock()
     fetch_server.url = URL_DUMMY
     options = fetchtv.Options([
         CMD_RECORDINGS, f'{OPTION_FOLDER}="{SHOW_ONE}"',
         f'{OPTION_TITLE}="{SHOW_ONE_EP_ONE}, {SHOW_ONE_EP_TWO}"'
     ])
     results = fetchtv.get_fetch_recordings(fetch_server, options)
     fetchtv.print_recordings(results)
     self.assertEqual(1, len(results))
     self.assertEqual(2, len(results[0]['items']))
示例#9
0
 def test_get_shows_json(self):
     fetch_server = Mock()
     fetch_server.url = URL_DUMMY
     options = fetchtv.Options([CMD_SHOWS, OPTION_JSON])
     results = fetchtv.get_fetch_recordings(fetch_server, options)
     output = fetchtv.print_recordings(results)
     output = json.loads(output)
     self.assertEqual(8, len(output))
示例#10
0
 def test_get_recordings_items_json(self):
     fetch_server = Mock()
     fetch_server.url = URL_DUMMY
     options = fetchtv.Options([CMD_IS_RECORDING, OPTION_JSON])
     results = fetchtv.get_fetch_recordings(fetch_server, options)
     output = fetchtv.print_recordings(results)
     output = json.loads(output)
     self.assertEqual(1, len(output))
     self.assertEqual(1, len(output[0]['items']))