Ejemplo n.º 1
0
    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')
Ejemplo n.º 2
0
    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'
Ejemplo n.º 3
0
    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() == ''
Ejemplo n.º 4
0
    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'
Ejemplo n.º 5
0
    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'
Ejemplo n.º 6
0
    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')
Ejemplo n.º 7
0
    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')
Ejemplo n.º 8
0
    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() == ''
Ejemplo n.º 9
0
    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() == ''
Ejemplo n.º 10
0
    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'
Ejemplo n.º 11
0
    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 '
Ejemplo n.º 12
0
    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() == ''
Ejemplo n.º 13
0
    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 '
Ejemplo n.º 14
0
    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