コード例 #1
0
ファイル: test_asx.py プロジェクト: jvrsantacruz/playlists
    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()))
コード例 #2
0
ファイル: test_asx.py プロジェクト: jvrsantacruz/playlists
    def test_parse_retrieves_title_and_path(self):
        playlist = Asx.parse(StringIO(ONE_TRACK_PL))

        assert_that(list(playlist), is_([(TITLE, PATH)]))
コード例 #3
0
ファイル: test_asx.py プロジェクト: jvrsantacruz/playlists
    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://')))
コード例 #4
0
ファイル: test_asx.py プロジェクト: jvrsantacruz/playlists
    def test_parse_parses_playlists(self):
        playlist = Asx.parse(StringIO(ONE_TRACK_PL))

        assert_that(playlist, has_len(1))
コード例 #5
0
ファイル: test_asx.py プロジェクト: jvrsantacruz/playlists
    def test_parse_takes_empty_playlists(self):
        playlist = Asx.parse(StringIO(EMPTY_PL))

        assert_that(playlist, is_(empty()))
コード例 #6
0
ファイル: test_asx.py プロジェクト: jvrsantacruz/playlists
 def test_parse_raises_parse_error_on_empty_documents(self):
     with assert_that_raises(AsxError):
         list(Asx.parse(StringIO()))
コード例 #7
0
ファイル: test_asx.py プロジェクト: jvrsantacruz/playlists
 def test_parse_takes_file_like_objects(self):
     Asx.parse(StringIO(u'<element/>'))
コード例 #8
0
ファイル: test_asx.py プロジェクト: jvrsantacruz/playlists
    def test_parse_parses_more_than_one_track(self):
        playlist = Asx.parse(StringIO(SEVERAL_TRACKS_PL))

        assert_that(playlist, has_len(2))