Example #1
0
    def testSelectPage2(self):
        application = ApplicationParams()
        application.wikiroot = self.wikiroot
        panel = FakeTagsPanel()
        TagsPanelController (panel, application)

        self.wikiroot.selectedPage = self.wikiroot[u"Страница 1"]
        self.assertTrue (u"тег 1" in panel.marks)

        application.wikiroot = None
        self.assertEqual (panel.marks, [])
Example #2
0
    def testSelectPage2(self):
        application = ApplicationParams()
        application.wikiroot = self.wikiroot
        panel = FakeTagsPanel()
        TagsPanelController(panel, application)

        self.wikiroot.selectedPage = self.wikiroot["Страница 1"]
        self.assertTrue("тег 1" in panel.marks)

        application.wikiroot = None
        self.assertEqual(panel.marks, [])
Example #3
0
    def testClear(self):
        application = ApplicationParams()
        application.wikiroot = self.wikiroot

        panel = FakeTagsPanel()
        TagsPanelController (panel, application)

        self.assertTrue (len (panel.tags) > 0)

        application.wikiroot = None

        self.assertTrue (len (panel.tags) == 0)
Example #4
0
    def testClear(self):
        application = ApplicationParams()
        application.wikiroot = self.wikiroot

        panel = FakeTagsPanel()
        TagsPanelController(panel, application)

        self.assertTrue(len(panel.tags) > 0)

        application.wikiroot = None

        self.assertTrue(len(panel.tags) == 0)
Example #5
0
    def testChangeTags (self):
        application = ApplicationParams()
        application.wikiroot = self.wikiroot
        panel = FakeTagsPanel()
        TagsPanelController (panel, application)

        self.wikiroot[u"Страница 2"].tags = [u"бла-бла-бла"]

        self.assertTrue (u"тег 1" in panel.tags)
        self.assertTrue (u"тег 2" not in panel.tags)
        self.assertTrue (u"тег 3" in panel.tags)
        self.assertTrue (u"тег 4" in panel.tags)
        self.assertTrue (u"бла-бла-бла" in panel.tags)
Example #6
0
    def testTagsChange (self):
        application = ApplicationParams()
        application.wikiroot = self.wikiroot
        panel = FakeTagsPanel()
        TagsPanelController (panel, application)

        self.wikiroot.selectedPage = self.wikiroot[u"Страница 1"]
        self.assertTrue (u"тег 1" in panel.marks)

        self.wikiroot[u"Страница 1"].tags = [u"тег 1", u"тег 2", u"тег 666"]
        self.assertTrue (u"тег 1" in panel.marks)
        self.assertTrue (u"тег 2" in panel.marks)
        self.assertTrue (u"тег 666" in panel.marks)
Example #7
0
    def testPageRemove (self):
        application = ApplicationParams()
        application.wikiroot = self.wikiroot

        panel = FakeTagsPanel()
        TagsPanelController (panel, application)

        self.wikiroot[u"Страница 2"].remove()

        self.assertTrue (u"тег 1" in panel.tags)
        self.assertTrue (u"тег 2" not in panel.tags)
        self.assertTrue (u"тег 3" not in panel.tags)
        self.assertTrue (u"тег 4" in panel.tags)
Example #8
0
    def testChangeTags(self):
        application = ApplicationParams()
        application.wikiroot = self.wikiroot
        panel = FakeTagsPanel()
        TagsPanelController(panel, application)

        self.wikiroot["Страница 2"].tags = ["бла-бла-бла"]

        self.assertTrue("тег 1" in panel.tags)
        self.assertTrue("тег 2" not in panel.tags)
        self.assertTrue("тег 3" in panel.tags)
        self.assertTrue("тег 4" in panel.tags)
        self.assertTrue("бла-бла-бла" in panel.tags)
Example #9
0
    def testTagsChange(self):
        application = ApplicationParams()
        application.wikiroot = self.wikiroot
        panel = FakeTagsPanel()
        TagsPanelController(panel, application)

        self.wikiroot.selectedPage = self.wikiroot["Страница 1"]
        self.assertTrue("тег 1" in panel.marks)

        self.wikiroot["Страница 1"].tags = ["тег 1", "тег 2", "тег 666"]
        self.assertTrue("тег 1" in panel.marks)
        self.assertTrue("тег 2" in panel.marks)
        self.assertTrue("тег 666" in panel.marks)
Example #10
0
    def testPageRemove(self):
        application = ApplicationParams()
        application.wikiroot = self.wikiroot

        panel = FakeTagsPanel()
        TagsPanelController(panel, application)

        self.wikiroot["Страница 2"].remove()

        self.assertTrue("тег 1" in panel.tags)
        self.assertTrue("тег 2" not in panel.tags)
        self.assertTrue("тег 3" not in panel.tags)
        self.assertTrue("тег 4" in panel.tags)
Example #11
0
    def testPageCreate (self):
        application = ApplicationParams()
        application.wikiroot = self.wikiroot

        panel = FakeTagsPanel()
        TagsPanelController (panel, application)

        TextPageFactory().create (self.wikiroot, u"Страница 10", [u"тег 10"])

        self.assertTrue (u"тег 10" in panel.tags)
        self.assertTrue (u"тег 1" in panel.tags)
        self.assertTrue (u"тег 2" in panel.tags)
        self.assertTrue (u"тег 3" in panel.tags)
        self.assertTrue (u"тег 4" in panel.tags)
Example #12
0
    def testPageCreate(self):
        application = ApplicationParams()
        application.wikiroot = self.wikiroot

        panel = FakeTagsPanel()
        TagsPanelController(panel, application)

        TextPageFactory().create(self.wikiroot, "Страница 10", ["тег 10"])

        self.assertTrue("тег 10" in panel.tags)
        self.assertTrue("тег 1" in panel.tags)
        self.assertTrue("тег 2" in panel.tags)
        self.assertTrue("тег 3" in panel.tags)
        self.assertTrue("тег 4" in panel.tags)
Example #13
0
    def testCreateTagsPanelController (self):
        application = ApplicationParams()
        application.wikiroot = self.wikiroot
        panel = FakeTagsPanel()

        self.assertEqual (panel.tags, [])

        TagsPanelController (panel, application)

        self.assertTrue (u"тег 1" in panel.tags)
        self.assertTrue (u"тег 2" in panel.tags)
        self.assertTrue (u"тег 3" in panel.tags)
        self.assertTrue (u"тег 4" in panel.tags)

        self.assertEqual (panel.marks, [])
Example #14
0
    def testCreateTagsPanelController(self):
        application = ApplicationParams()
        application.wikiroot = self.wikiroot
        panel = FakeTagsPanel()

        self.assertEqual(panel.tags, [])

        TagsPanelController(panel, application)

        self.assertTrue("тег 1" in panel.tags)
        self.assertTrue("тег 2" in panel.tags)
        self.assertTrue("тег 3" in panel.tags)
        self.assertTrue("тег 4" in panel.tags)

        self.assertEqual(panel.marks, [])