Esempio n. 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()))
Esempio n. 2
0
    def test_parse_retrieves_title_and_path(self):
        playlist = Asx.parse(StringIO(ONE_TRACK_PL))

        assert_that(list(playlist), is_([(TITLE, PATH)]))
Esempio n. 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://')))
Esempio n. 4
0
    def test_parse_parses_playlists(self):
        playlist = Asx.parse(StringIO(ONE_TRACK_PL))

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

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

        assert_that(playlist, has_len(2))