コード例 #1
0
ファイル: test_twitter.py プロジェクト: juanitodread/gorrion
    def test_album_media_link_with_album_media_link_true(
            self, track, tweet_config):
        tweet_config.footer_config.with_album_media_link = True
        footer_template = FooterTemplate(track, tweet_config.footer_config)

        assert (footer_template.album_media_link() ==
                'http://spotify.com/album/11?si=g')
コード例 #2
0
ファイル: test_twitter.py プロジェクト: juanitodread/gorrion
    def test_song_media_link_with_song_media_link_true(self, track,
                                                       tweet_config):
        tweet_config.footer_config.with_song_media_link = True
        footer_template = FooterTemplate(track, tweet_config.footer_config)

        assert footer_template.song_media_link(
        ) == 'http://spotify.com/track/1'
コード例 #3
0
ファイル: test_twitter.py プロジェクト: juanitodread/gorrion
    def test_to_footer_default_config(self, track, tweet_config):
        tweet_config.footer_config.with_gorrion_hashtags = False
        tweet_config.footer_config.with_album_hashtag = False
        tweet_config.footer_config.with_artists_hashtag = False
        tweet_config.footer_config.with_song_media_link = False
        tweet_config.footer_config.with_album_media_link = False
        footer_template = FooterTemplate(track, tweet_config.footer_config)

        assert footer_template.to_footer() == ''
コード例 #4
0
ファイル: test_twitter.py プロジェクト: juanitodread/gorrion
    def test_to_footer_with_song_media_link_only(self, track, tweet_config):
        tweet_config.footer_config.with_gorrion_hashtags = False
        tweet_config.footer_config.with_album_hashtag = False
        tweet_config.footer_config.with_artists_hashtag = False
        tweet_config.footer_config.with_song_media_link = True
        tweet_config.footer_config.with_album_media_link = False
        footer_template = FooterTemplate(track, tweet_config.footer_config)

        assert footer_template.to_footer() == 'http://spotify.com/track/1'
コード例 #5
0
ファイル: test_twitter.py プロジェクト: juanitodread/gorrion
    def test_to_footer_with_artists_hashtag_only(self, track, tweet_config):
        tweet_config.footer_config.with_gorrion_hashtags = False
        tweet_config.footer_config.with_album_hashtag = False
        tweet_config.footer_config.with_artists_hashtag = True
        tweet_config.footer_config.with_song_media_link = False
        tweet_config.footer_config.with_album_media_link = False
        footer_template = FooterTemplate(track, tweet_config.footer_config)

        assert footer_template.to_footer() == '#ElyGuerra\n\n'
コード例 #6
0
ファイル: test_twitter.py プロジェクト: juanitodread/gorrion
    def test_to_footer_with_hashtags_only(self, track, tweet_config):
        tweet_config.footer_config.with_gorrion_hashtags = True
        tweet_config.footer_config.with_album_hashtag = True
        tweet_config.footer_config.with_artists_hashtag = True
        tweet_config.footer_config.with_song_media_link = False
        tweet_config.footer_config.with_album_media_link = False
        footer_template = FooterTemplate(track, tweet_config.footer_config)

        assert footer_template.to_footer() == ('#gorrion #NowPlaying '
                                               '#PaMorirseDeAmor '
                                               '#ElyGuerra\n\n')
コード例 #7
0
ファイル: test_twitter.py プロジェクト: juanitodread/gorrion
    def test_build_hashtag(self, track, tweet_config):
        footer_template = FooterTemplate(track, tweet_config.footer_config)

        assert footer_template._build_hashtag('') == ''
        assert footer_template._build_hashtag('alpha-only') == '#Alphaonly'
        assert footer_template._build_hashtag('digit-only') == '#Digitonly'
        assert footer_template._build_hashtag('no more') == '#NoMore'
        assert footer_template._build_hashtag('  alone   ') == '#Alone'
        assert (footer_template._build_hashtag('thIS iS a AM vAlID') ==
                '#ThisIsAAMValid')
コード例 #8
0
ファイル: test_twitter.py プロジェクト: juanitodread/gorrion
    def test_album_media_link_with_album_media_link_false(
            self, track, tweet_config):
        tweet_config.footer_config.with_album_media_link = False
        footer_template = FooterTemplate(track, tweet_config.footer_config)

        assert footer_template.album_media_link() == ''
コード例 #9
0
ファイル: test_twitter.py プロジェクト: juanitodread/gorrion
    def test_artists_hashtags_with_artists_hashtag_false(
            self, track, tweet_config):
        tweet_config.footer_config.with_artists_hashtag = False
        footer_template = FooterTemplate(track, tweet_config.footer_config)

        assert footer_template.artists_hashtags() == ''
コード例 #10
0
ファイル: test_twitter.py プロジェクト: juanitodread/gorrion
    def test_artists_hashtags_with_artists_hashtag_true(
            self, track, tweet_config):
        tweet_config.footer_config.with_artists_hashtag = True
        footer_template = FooterTemplate(track, tweet_config.footer_config)

        assert footer_template.artists_hashtags() == '#ElyGuerra'
コード例 #11
0
ファイル: test_twitter.py プロジェクト: juanitodread/gorrion
    def test_album_hashtags_with_album_hashtag_true(self, track, tweet_config):
        tweet_config.footer_config.with_album_hashtag = True
        footer_template = FooterTemplate(track, tweet_config.footer_config)

        assert footer_template.album_hashtags() == '#PaMorirseDeAmor '
コード例 #12
0
ファイル: test_twitter.py プロジェクト: juanitodread/gorrion
    def test_gorrion_hashtags_with_gorrion_hashtags_false(
            self, track, tweet_config):
        tweet_config.footer_config.with_gorrion_hashtags = False
        footer_template = FooterTemplate(track, tweet_config.footer_config)

        assert footer_template.gorrion_hashtags() == ''
コード例 #13
0
ファイル: test_twitter.py プロジェクト: juanitodread/gorrion
    def test_gorrion_hashtags_with_gorrion_hashtags_true(
            self, track, tweet_config):
        tweet_config.footer_config.with_gorrion_hashtags = True
        footer_template = FooterTemplate(track, tweet_config.footer_config)

        assert footer_template.gorrion_hashtags() == '#gorrion #NowPlaying '
コード例 #14
0
ファイル: test_twitter.py プロジェクト: juanitodread/gorrion
    def test_constructor(self, track, tweet_config):
        footer_template = FooterTemplate(track, tweet_config.footer_config)

        assert footer_template._track == track
        assert footer_template._config == tweet_config.footer_config