def test_cb_story(self):
        req = pyblosxom.Request(
            self.config, self.environ,
            {"acronyms": acronyms.build_acronyms(["FOO = bar"])})

        # basic test
        args = {"request": req, "entry": {"body": "<p>This is FOO!</p>"}}

        ret = acronyms.cb_story(args)

        self.assertEquals(
            args["entry"]["body"],
            "<p>This is <acronym title=\"bar\">FOO</acronym>!</p>")

        # test to make sure substitutions don't happen in tags
        args = {"request": req, "entry": {"body": "<FOO>This is FOO!</FOO>"}}

        ret = acronyms.cb_story(args)

        self.assertEquals(
            args["entry"]["body"],
            "<FOO>This is <acronym title=\"bar\">FOO</acronym>!</FOO>")
    def test_cb_story(self):
        req = pyblosxom.Request(
            self.config, self.environ,
            {"acronyms":acronyms.build_acronyms(["FOO = bar"])})

        # basic test
        args = {"request": req,
                "entry": {"body": "<p>This is FOO!</p>"}}

        ret = acronyms.cb_story(args)

        self.assertEquals(
            args["entry"]["body"],
            "<p>This is <acronym title=\"bar\">FOO</acronym>!</p>")

        # test to make sure substitutions don't happen in tags
        args = {"request": req,
                "entry": {"body": "<FOO>This is FOO!</FOO>"}}

        ret = acronyms.cb_story(args)

        self.assertEquals(
            args["entry"]["body"],
            "<FOO>This is <acronym title=\"bar\">FOO</acronym>!</FOO>")
 def check_this(lines, output):
     for inmem, outmem in zip(acronyms.build_acronyms(lines), output):
         self.assertEquals(inmem[0].pattern, outmem[0])
         self.assertEquals(inmem[1], outmem[1])
 def check_this(lines, output):
     for inmem, outmem in zip(acronyms.build_acronyms(lines), output):
         self.assertEquals(inmem[0].pattern, outmem[0])
         self.assertEquals(inmem[1], outmem[1])