Exemplo n.º 1
0
    def test_remove_homepage_notifications_multiple_homepages(self):
        from tests.test_episode import EpisodeParserForTests

        user = User("*****@*****.**")

        homepage1 = Homepage("www.test1.com", EpisodeParserForTests)
        homepage2 = Homepage("www.test2.com", EpisodeParserForTests)
        homepages = [homepage1, homepage2]
        user.add_homepage_notifications(homepages)
        user.remove_homepage_notifications(homepages)

        assert len(user.homepages) == 0
Exemplo n.º 2
0
    def test_add_homepage_notifications_single_homepage(self):
        from tests.test_episode import EpisodeParserForTests

        user = User("*****@*****.**")

        homepage = Homepage("www.test.com", EpisodeParserForTests)
        user.add_homepage_notifications(homepage)
        assert user.homepages[homepage.url] == homepage
Exemplo n.º 3
0
 def test_homepage_object_creation(self):
     class TestEpisodeParser(EpisodeParser):
         def parse_to_list_of_episodes(self, homepage:"Homepage") -> List["Episode"]:
             pass
     
     url = "https://www.test.com"
     episode_parser = TestEpisodeParser
     homepage = Homepage(url, episode_parser=episode_parser, name="Test")
Exemplo n.º 4
0
    def test_identify_new_episodes(self):
        name = "TestEpisode"
        url = "https://www.test.com"

        episode_1 = Episode(name, url, 123)
        episode_2 = Episode(name, url, 124)
        episode_3 = Episode(name, url, 125)

        old_episodes = [episode_2, episode_1]
        new_episodes = [episode_1, episode_2, episode_3] 
        diff_episodes = [episode_3]

        calculated_diff_episodes = Homepage._Homepage__identify_new_episodes(None, old_episodes, new_episodes)

        assert calculated_diff_episodes == diff_episodes
Exemplo n.º 5
0
#############
import logging

logging.basicConfig(level=logging.DEBUG, filename='logging.log')
logger = logging.getLogger(__name__)

#################################
#   Create users to be notified #
#################################
user = User(config("USER_EMAIL"))

#################################
#   Register user for updates   #
#################################
user.add_homepage_notifications([
    Homepage("https://dragonball-tube.com/dragonball-super-episoden-streams",
             MediaitemEpisodeParser),
    Homepage("http://dragonball-tube.com/dragonball-super-mangaliste",
             MediaitemEpisodeParser),
    Homepage("http://dragonball-tube.com/galactic-patrol-mangaliste",
             MediaitemEpisodeParser),
    Homepage("https://onepiece-tube.com/episoden-streams",
             MediaitemEpisodeParser),
    Homepage("https://onepiece-tube.com/kapitel-mangaliste",
             SagatableEpisodeParser),
    Homepage("http://fairytail-tube.org/episoden-streams",
             MediaitemEpisodeParser),
    Homepage("http://fairytail-tube.org/100-years-quest-mangaliste",
             MediaitemEpisodeParser),
    Homepage("http://fairytail-tube.org/edens-zero-mangaliste",
             MediaitemEpisodeParser),
    Homepage("http://naruto-tube.org/boruto-episoden-streams",