Here are the examples of the python api mock.sentinel.onlyChild taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2 Examples
3
Example 1
Project: dirigible-spreadsheet Source File: test_fl_reference_parse_node.py
Function: testcanonicalise
Function: testcanonicalise
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)
0
Example 2
Project: dirigible-spreadsheet Source File: test_fl_reference_parse_node.py
def testWorksheetReferenceProperty(self):
ref = FLReferenceParseNode(None, [sentinel.onlyChild])
self.assertEquals(ref.worksheetReference, None)
ref = FLReferenceParseNode(None, ["'Thin Lizzy' ", sentinel.second, sentinel.third])
self.assertEquals(ref.children[0], "'Thin Lizzy' ")
self.assertEquals(ref.worksheetReference, 'Thin Lizzy')
# loses the whitespace information
ref.worksheetReference = None
self.assertEquals(ref.children, [sentinel.third])
# therefore no whitespace information here
ref.worksheetReference = "Ben Folds' Five "
self.assertEquals(ref.children, ["'Ben Folds'' Five '", '!', sentinel.third])
self.assertEquals(ref.worksheetReference, "Ben Folds' Five ")
ref.children[0] = "'with trailing whitespace' "
ref.worksheetReference = "Shihad"
self.assertEquals(ref.children, ["Shihad ", '!', sentinel.third])