예제 #1
0
    def test_parse_parses_playlists(self):
        playlist = Xspf.parse(StringIO(ONE_TRACK_PL))

        assert_that(playlist, has_len(1))
예제 #2
0
 def test_parse_raises_parse_error_on_empty_documents(self):
     with assert_that_raises(XspfError):
         list(Xspf.parse(StringIO()))
예제 #3
0
    def test_parse_takes_empty_playlists(self):
        playlist = Xspf.parse(StringIO(EMPTY_PL))

        assert_that(playlist, is_(empty()))
예제 #4
0
 def test_parse_takes_file_like_objects(self):
     Xspf.parse(StringIO(u'<element/>'))
예제 #5
0
    def test_parse_parses_more_than_one_track(self):
        playlist = Xspf.parse(StringIO(SEVERAL_TRACKS_PL))

        assert_that(playlist, has_len(2))
예제 #6
0
    def test_parse_fills_missing_fields_with_none(self):
        playlist = Xspf.parse(StringIO(MISSING_TITLE_PL))

        track = list(playlist)[0]

        assert_that(track[0], is_(none()))
예제 #7
0
    def test_parse_retrieves_path_without_file_prefix(self):
        playlist = Xspf.parse(StringIO(ONE_TRACK_PL))

        track = list(playlist)[0]

        assert_that(track[1], does_not(starts_with('file://')))
예제 #8
0
    def test_parse_retrieves_title_and_path(self):
        playlist = Xspf.parse(StringIO(ONE_TRACK_PL))

        assert_that(list(playlist), is_([(TITLE, PATH)]))