コード例 #1
0
    def test_idNotSetButEnclosureIsUsed(self):
        guid = "http://example.com/podcast/episode1.mp3"
        episode = Episode()
        episode.title = "My first episode"
        episode.media = Media(guid, 97423487, "audio/mpeg")

        item = episode.rss_entry()
        assert item.find("guid").text == guid
コード例 #2
0
    def test_idIsSet(self):
        guid = "http://example.com/podcast/episode1"
        episode = Episode()
        episode.title = "My first episode"
        episode.id = guid
        item = episode.rss_entry()

        assert item.find("guid").text == guid
コード例 #3
0
ファイル: test_episode.py プロジェクト: tobinus/python-podgen
    def test_idNotSetButEnclosureIsUsed(self):
        guid = "http://example.com/podcast/episode1.mp3"
        episode = Episode()
        episode.title = "My first episode"
        episode.media = Media(guid, 97423487, "audio/mpeg")

        item = episode.rss_entry()
        assert item.find("guid").text == guid
コード例 #4
0
ファイル: test_episode.py プロジェクト: tobinus/python-podgen
    def test_idIsSet(self):
        guid = "http://example.com/podcast/episode1"
        episode = Episode()
        episode.title = "My first episode"
        episode.id = guid
        item = episode.rss_entry()

        assert item.find("guid").text == guid
コード例 #5
0
    def test_idSetToFalseSoEnclosureNotUsed(self):
        episode = Episode()
        episode.title = "My first episode"
        episode.media = Media("http://example.com/podcast/episode1.mp3",
                              34328731, "audio/mpeg")
        episode.id = False

        item = episode.rss_entry()
        assert item.find("guid") is None
コード例 #6
0
ファイル: test_episode.py プロジェクト: tobinus/python-podgen
    def test_idSetToFalseSoEnclosureNotUsed(self):
        episode = Episode()
        episode.title = "My first episode"
        episode.media = Media("http://example.com/podcast/episode1.mp3",
                            34328731, "audio/mpeg")
        episode.id = False

        item = episode.rss_entry()
        assert item.find("guid") is None
コード例 #7
0
    def test_mandatoryAttributes(self):
        ep = Episode()
        self.assertRaises((RuntimeError, ValueError), ep.rss_entry)

        ep.title = "A title"
        ep.rss_entry()

        ep.title = ""
        self.assertRaises((RuntimeError, ValueError), ep.rss_entry)

        ep.title = None
        self.assertRaises((RuntimeError, ValueError), ep.rss_entry)

        ep.summary = "A summary"
        ep.rss_entry()

        ep.summary = ""
        self.assertRaises((RuntimeError, ValueError), ep.rss_entry)

        ep.summary = None
        self.assertRaises((RuntimeError, ValueError), ep.rss_entry)
コード例 #8
0
ファイル: test_episode.py プロジェクト: tobinus/python-podgen
    def test_mandatoryAttributes(self):
        ep = Episode()
        self.assertRaises((RuntimeError, ValueError), ep.rss_entry)

        ep.title = "A title"
        ep.rss_entry()

        ep.title = ""
        self.assertRaises((RuntimeError, ValueError), ep.rss_entry)

        ep.title = None
        self.assertRaises((RuntimeError, ValueError), ep.rss_entry)

        ep.summary = "A summary"
        ep.rss_entry()

        ep.summary = ""
        self.assertRaises((RuntimeError, ValueError), ep.rss_entry)

        ep.summary = None
        self.assertRaises((RuntimeError, ValueError), ep.rss_entry)