Exemplo n.º 1
0
    def test_group(self):
        p = PanePattern("a\:b:<title>")
        self.failUnlessEqual(p.title, "A:B")
        self.failUnlessEqual(set(p.format_display(ALBUM).split(", ")),
                             set(["one", "two", "three"]))

        p = PanePattern("foo:~#lastplayed")
        self.failUnlessEqual(p.format_display(ALBUM), "0")

        p = PanePattern("foo:title")
        self.failUnlessEqual(set(p.format_display(ALBUM).split(", ")),
                             set(["one", "two", "three"]))
Exemplo n.º 2
0
    def test_tag(self):
        p = PanePattern("title")
        self.failUnlessEqual(p.title, "Title")
        self.failUnlessEqual(p.tags, set(["title"]))

        self.failUnlessEqual(p.format(SONGS[0]), ["three"])
        self.failUnless("3" in p.format_display(ALBUM))
        self.failIf(p.has_markup)