Esempio n. 1
0
    def test_insideScope(self):
        # @@ this test passes without "scope". bogus?
        f2 = makeContent(self.folder, 'f2', 'Folder')
        w1 = makeContent(f2, 'w1', 'IronicWiki', title='W1 Title')

        self.set_text(w1, "((%s))" % self.page1.Title())
        self.failUnlessWickedLink(w1, self.page1)
Esempio n. 2
0
 def test_outsideScope(self):
     f2 = makeContent(self.folder, 'f2', 'Folder')
     f3 = makeContent(f2, 'f3', 'Folder')
     w1 = makeContent(f3, 'w1', 'IronicWiki',
                       title='W1 Title')
     self.set_text(w1, "((%s))" % self.page1.Title())
     self.failIfWickedLink(w1, self.page1)
Esempio n. 3
0
 def testLocalTitleBeatsRemoteId(self):
     self.replaceCreatedIndex()
     f2 = makeContent(self.folder, 'f2', 'Folder')
     w1 = makeContent(f2, 'w1_id', self.wicked_type, title=self.page1.id)
     w2 = makeContent(f2, 'w2_id', self.wicked_type, title='W2 Title')
     self.set_text(w2, "((%s))" % self.page1.id)
     self.failUnlessWickedLink(w2, w1)
     self.failIfWickedLink(w2, self.page1)
Esempio n. 4
0
 def testInexactLocalTitleNotBlockLocalTitle(self):
     w1 = makeContent(self.folder, 'w1', self.wicked_type,
                      title='W1 Title')
     w2 = makeContent(self.folder, 'w2', self.wicked_type,
                      title='%s With Extra' % w1.Title())
     self.set_text(self.page1, "((%s))" % w1.Title())
     self.failUnlessWickedLink(self.page1, w1)
     self.failIfWickedLink(self.page1, w2)
Esempio n. 5
0
 def test_insideScope(self):
     # @@ this test passes without "scope". bogus?
     f2 = makeContent(self.folder, 'f2', 'Folder')
     w1 = makeContent(f2, 'w1', 'IronicWiki',
                       title='W1 Title')
     
     self.set_text(w1, "((%s))" % self.page1.Title())
     self.failUnlessWickedLink(w1, self.page1)
Esempio n. 6
0
 def testInexactLocalTitleNotBlockLocalTitle(self):
     w1 = makeContent(self.folder, 'w1', self.wicked_type, title='W1 Title')
     w2 = makeContent(self.folder,
                      'w2',
                      self.wicked_type,
                      title='%s With Extra' % w1.Title())
     self.set_text(self.page1, "((%s))" % w1.Title())
     self.failUnlessWickedLink(self.page1, w1)
     self.failIfWickedLink(self.page1, w2)
Esempio n. 7
0
 def testLocalTitleBeatsRemoteId(self):
     self.replaceCreatedIndex()
     f2 = makeContent(self.folder, 'f2', 'Folder')
     w1 = makeContent(f2, 'w1_id', self.wicked_type,
                      title=self.page1.id)
     w2 = makeContent(f2, 'w2_id', self.wicked_type,
                      title='W2 Title')
     self.set_text(w2, "((%s))" % self.page1.id)
     self.failUnlessWickedLink(w2, w1)
     self.failIfWickedLink(w2, self.page1)
Esempio n. 8
0
 def testInexactLocalTitleNotBlockRemoteId(self):
     f2 = makeContent(self.folder, 'f2', 'Folder')
     w1 = makeContent(self.folder, 'w1', self.wicked_type, title='W1 Title')
     w2 = makeContent(f2,
                      'w2',
                      self.wicked_type,
                      title='%s With Extra' % w1.id)
     w3 = makeContent(f2, 'w3', self.wicked_type, title='W3 Title')
     self.set_text(w3, "((%s))" % w1.id)
     self.failUnlessWickedLink(w3, w1)
     self.failIfWickedLink(w3, w2)
Esempio n. 9
0
 def testInexactRemoteTitleNotBlockRemoteId(self):
     f2 = makeContent(self.folder, 'f2', 'Folder')
     w1 = makeContent(self.folder, 'w1', self.wicked_type,
                      title='W1 Title')
     w2 = makeContent(self.folder, 'w2', self.wicked_type,
                      title='%s With Extra' % w1.id)
     w3 = makeContent(f2, 'w3', self.wicked_type,
                      title='W3 Title')
     self.set_text(w3, "((%s))" % w1.id)
     self.failUnlessWickedLink(w3, w1)
     self.failIfWickedLink(w3, w2)
Esempio n. 10
0
    def testDupLocalTitleMatchesOldest(self):
        self.replaceCreatedIndex()
        title = 'Duplicate Title'
        w1 = makeContent(self.folder, 'w1', self.wicked_type, title=title)
        w2 = makeContent(self.folder, 'w2', self.wicked_type, title=title)
        w3 = makeContent(self.folder, 'w3', self.wicked_type, title=title)
        self.set_text(self.page1, "((%s))" % title)
        self.failUnlessWickedLink(self.page1, w1)

        # this also tests that deleting uncaches
        self.folder.manage_delObjects(ids=[w1.getId()])

        self.failUnlessWickedLink(self.page1, w2)
Esempio n. 11
0
    def testDupLocalTitleMatchesOldest(self):
        self.replaceCreatedIndex()
        title = 'Duplicate Title'
        w1 = makeContent(self.folder, 'w1', self.wicked_type,
                         title=title)
        w2 = makeContent(self.folder, 'w2', self.wicked_type,
                         title=title)
        w3 = makeContent(self.folder, 'w3', self.wicked_type,
                         title=title)
        self.set_text(self.page1, "((%s))" % title)
        self.failUnlessWickedLink(self.page1, w1)

        # this also tests that deleting uncaches
        self.folder.manage_delObjects(ids=[w1.getId()])

        self.failUnlessWickedLink(self.page1, w2)
Esempio n. 12
0
 def testInexactTitleNotMatch(self):
     w1 = makeContent(self.folder,
                      'w1',
                      self.wicked_type,
                      title='W1 Title With Extra')
     self.set_text(self.page1, "((W1 Title))")
     self.failIfWickedLink(self.page1, w1)
     self.failUnlessAddLink(self.page1)
Esempio n. 13
0
    def testDupRemoteTitleMatchesOldest(self):
        self.replaceCreatedIndex()
        title = 'Duplicate Title'

        f2, f3, f4 = self.makeFolders('f2', 'f3', 'f4')

        w1 = makeContent(f2, 'w1', self.wicked_type, title=title)
        # mix up the order, just to make sure
        w3 = makeContent(f4, 'w3', self.wicked_type, title=title)
        w2 = makeContent(f3, 'w2', self.wicked_type, title=title)
        self.set_text(self.page1, "((%s))" % title)
        self.failUnlessWickedLink(self.page1, w1)
        self.failIfWickedLink(self.page1, w2)
        self.failIfWickedLink(self.page1, w3)

        f2.manage_delObjects(ids=[w1.id])
        self.failUnlessWickedLink(self.page1, w3)
        self.failIfWickedLink(self.page1, w2)
Esempio n. 14
0
    def testDupRemoteTitleMatchesOldest(self):
        self.replaceCreatedIndex()
        title = 'Duplicate Title'
        
        f2, f3, f4 = self.makeFolders('f2', 'f3', 'f4')

        w1 = makeContent(f2, 'w1', self.wicked_type,
                         title=title)
        # mix up the order, just to make sure
        w3 = makeContent(f4, 'w3', self.wicked_type,
                         title=title)
        w2 = makeContent(f3, 'w2', self.wicked_type,
                         title=title)
        self.set_text(self.page1, "((%s))" % title)
        self.failUnlessWickedLink(self.page1, w1)
        self.failIfWickedLink(self.page1, w2)
        self.failIfWickedLink(self.page1, w3)

        f2.manage_delObjects(ids=[w1.id])
        self.failUnlessWickedLink(self.page1, w3)
        self.failIfWickedLink(self.page1, w2)
Esempio n. 15
0
    def testLinkPersistsThroughMove(self):
        title = 'Move Me'
        f2, f3 = self.makeFolders('f2', 'f3')
        w1 = makeContent(f2, 'w1', self.wicked_type, title=title)

        # check implicit resolution
        # this is a pre-test
        # should set cache
        self.set_text(self.page1, "((%s))" % title)
        self.failUnlessWickedLink(self.page1, w1)

        # move w1
        self.moveContent(w1, f3)

        w1.setTitle('new title to make sure we do not accidentally resolve')

        # check link did not change
        self.failUnlessWickedLink(self.page1, w1)
Esempio n. 16
0
    def testLinkPersistsThroughMove(self):
        title = 'Move Me'
        f2, f3 = self.makeFolders('f2', 'f3')
        w1 = makeContent(f2, 'w1', self.wicked_type,
                         title=title)
        
        # check implicit resolution
        # this is a pre-test
        # should set cache
        self.set_text(self.page1, "((%s))" % title)
        self.failUnlessWickedLink(self.page1, w1)

        # move w1
        self.moveContent(w1, f3)

        w1.setTitle('new title to make sure we do not accidentally resolve')
        
        # check link did not change
        self.failUnlessWickedLink(self.page1, w1)
Esempio n. 17
0
    def testDupRemoteIdMatchesOldest(self):
        self.replaceCreatedIndex()
        id = 'duplicate_id'
        f2 = makeContent(self.folder, 'f2', 'Folder')
        f3 = makeContent(self.folder, 'f3', 'Folder')
        f4 = makeContent(self.folder, 'f4', 'Folder')
        w1 = makeContent(f2, id, self.wicked_type, title='W1 Title')
        # mix up the order, just to make sure
        w3 = makeContent(f4, id, self.wicked_type, title='W3 Title')
        w2 = makeContent(f3, id, self.wicked_type, title='W2 Title')
        self.set_text(self.page1, "((%s))" % id)
        self.failIfWickedLink(self.page1, w2)
        self.failIfWickedLink(self.page1, w3)
        self.failUnlessWickedLink(self.page1, w1)

        f2.manage_delObjects(ids=[w1.id])
        self.failIfWickedLink(self.page1, w2)

        # fails due to caching
        self.failUnlessWickedLink(self.page1, w3)
Esempio n. 18
0
    def testDupRemoteIdMatchesOldest(self):
        self.replaceCreatedIndex()
        id = 'duplicate_id'
        f2 = makeContent(self.folder, 'f2', 'Folder')
        f3 = makeContent(self.folder, 'f3', 'Folder')
        f4 = makeContent(self.folder, 'f4', 'Folder')
        w1 = makeContent(f2, id, self.wicked_type,
                         title='W1 Title')
        # mix up the order, just to make sure
        w3 = makeContent(f4, id, self.wicked_type,
                         title='W3 Title')
        w2 = makeContent(f3, id, self.wicked_type,
                         title='W2 Title')
        self.set_text(self.page1, "((%s))" % id)
        self.failIfWickedLink(self.page1, w2)
        self.failIfWickedLink(self.page1, w3)
        self.failUnlessWickedLink(self.page1, w1)

        f2.manage_delObjects(ids=[w1.id])
        self.failIfWickedLink(self.page1, w2)

        # fails due to caching
        self.failUnlessWickedLink(self.page1, w3)
Esempio n. 19
0
 def makeFolders(self, *args):
     folders = list()
     for id in args:
         folders.append(makeContent(self.folder, id, 'Folder'))
     return tuple(folders)
Esempio n. 20
0
 def testInexactTitleNotMatch(self):
     w1 = makeContent(self.folder, 'w1', self.wicked_type,
                      title='W1 Title With Extra')
     self.set_text(self.page1, "((W1 Title))")
     self.failIfWickedLink(self.page1, w1)
     self.failUnlessAddLink(self.page1)
Esempio n. 21
0
 def makeFolders(self, *args):
     folders = list()
     for id in args:
         folders.append(makeContent(self.folder, id, 'Folder'))
     return tuple(folders)
Esempio n. 22
0
 def test_outsideScope(self):
     f2 = makeContent(self.folder, 'f2', 'Folder')
     f3 = makeContent(f2, 'f3', 'Folder')
     w1 = makeContent(f3, 'w1', 'IronicWiki', title='W1 Title')
     self.set_text(w1, "((%s))" % self.page1.Title())
     self.failIfWickedLink(w1, self.page1)