Ejemplo n.º 1
0
    def test__process_track_missing_type(self):
        """Test _process_track method for track missing type."""
        MOCK_MediaInfoFetcher.reset_mock()
        track = OrderedDict()

        with self.assertRaises(InvalidMediaInfoError):
            MediaInfoFetcher._process_track(MOCK_MediaInfoFetcher, track)
Ejemplo n.º 2
0
    def test__process_track_text(self):
        """Test _process_track method for text track."""
        MOCK_MediaInfoFetcher.reset_mock()
        track = OrderedDict([('@type', 'Text')])

        MediaInfoFetcher._process_track(MOCK_MediaInfoFetcher, track)

        MOCK_MediaInfoFetcher._process_text.assert_called_once_with(track)
Ejemplo n.º 3
0
    def test__process_track_general(self):
        """Test _process_track method for general track."""
        MOCK_MediaInfoFetcher.reset_mock()
        track = OrderedDict([('@type', 'General')])

        MediaInfoFetcher._process_track(MOCK_MediaInfoFetcher, track)

        MOCK_MediaInfoFetcher._process_general.assert_called_once_with(track)
Ejemplo n.º 4
0
    def test__process_track_audio(self):
        """
        Test _process_track method for audio track.

        This is currently not supported.
        """
        MOCK_MediaInfoFetcher.reset_mock()
        track = OrderedDict([('@type', 'Audio')])

        MediaInfoFetcher._process_track(MOCK_MediaInfoFetcher, track)

        MOCK_MediaInfoFetcher._process_audio.assert_not_called()
Ejemplo n.º 5
0
    def test__process_track_not_ordereddict(self):
        """Test _process_track method for invalid track."""
        MOCK_MediaInfoFetcher.reset_mock()
        track = {}

        result = MediaInfoFetcher._process_track(MOCK_MediaInfoFetcher, track)

        self.assertIsNone(result)