Beispiel #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')
Beispiel #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'
Beispiel #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() == ''
Beispiel #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'
Beispiel #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'
Beispiel #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')
Beispiel #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')
Beispiel #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() == ''
Beispiel #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() == ''
Beispiel #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'
Beispiel #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 '
Beispiel #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() == ''
Beispiel #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 '
Beispiel #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