def testCanonicalise(self):
        def assertCanon(reference, worksheetNames, expected):
            ref = FLReferenceParseNode(None, [reference, '!', sentinel.onlyChild])
            ref.canonicalise(worksheetNames)
            self.assertEquals(ref.children[0], expected)

        assertCanon('foo', ['foO'], 'foO')
        assertCanon('foo', [], 'foo')
        assertCanon("'''s'", ["'S"], "'''S'")
        assertCanon("foo  ", [], 'foo  ')

        ref = FLReferenceParseNode(None, ['A1'])
        ref.canonicalise([])
        self.assertEquals(ref.worksheetReference, None)
示例#2
0
    def testCanonicalise(self):
        def assertCanon(reference, worksheetNames, expected):
            ref = FLReferenceParseNode(None,
                                       [reference, '!', sentinel.onlyChild])
            ref.canonicalise(worksheetNames)
            self.assertEquals(ref.children[0], expected)

        assertCanon('foo', ['foO'], 'foO')
        assertCanon('foo', [], 'foo')
        assertCanon("'''s'", ["'S"], "'''S'")
        assertCanon("foo  ", [], 'foo  ')

        ref = FLReferenceParseNode(None, ['A1'])
        ref.canonicalise([])
        self.assertEquals(ref.worksheetReference, None)
 def canonicalise(self, wsNames):
     self.localReference = self.localReference.upper()
     FLReferenceParseNode.canonicalise(self, wsNames)
示例#4
0
 def canonicalise(self, wsNames):
     self.localReference = self.localReference.upper()
     FLReferenceParseNode.canonicalise(self, wsNames)
 def assertCanon(reference, worksheetNames, expected):
     ref = FLReferenceParseNode(None, [reference, '!', sentinel.onlyChild])
     ref.canonicalise(worksheetNames)
     self.assertEquals(ref.children[0], expected)
示例#6
0
 def assertCanon(reference, worksheetNames, expected):
     ref = FLReferenceParseNode(None,
                                [reference, '!', sentinel.onlyChild])
     ref.canonicalise(worksheetNames)
     self.assertEquals(ref.children[0], expected)