Example #1
0
    def test_parse_fills_missing_fields_with_none(self):
        playlist = Asx.parse(StringIO(MISSING_TITLE_PL))

        track = list(playlist)[0]

        assert_that(track[0], is_(none()))
Example #2
0
    def test_parse_retrieves_title_and_path(self):
        playlist = Asx.parse(StringIO(ONE_TRACK_PL))

        assert_that(list(playlist), is_([(TITLE, PATH)]))
Example #3
0
    def test_parse_retrieves_path_without_file_prefix(self):
        playlist = Asx.parse(StringIO(ONE_TRACK_PL))

        track = list(playlist)[0]

        assert_that(track[1], does_not(starts_with('file://')))
Example #4
0
    def test_parse_parses_playlists(self):
        playlist = Asx.parse(StringIO(ONE_TRACK_PL))

        assert_that(playlist, has_len(1))
Example #5
0
    def test_parse_takes_empty_playlists(self):
        playlist = Asx.parse(StringIO(EMPTY_PL))

        assert_that(playlist, is_(empty()))
Example #6
0
 def test_parse_raises_parse_error_on_empty_documents(self):
     with assert_that_raises(AsxError):
         list(Asx.parse(StringIO()))
Example #7
0
 def test_parse_takes_file_like_objects(self):
     Asx.parse(StringIO(u'<element/>'))
Example #8
0
    def test_parse_parses_more_than_one_track(self):
        playlist = Asx.parse(StringIO(SEVERAL_TRACKS_PL))

        assert_that(playlist, has_len(2))