Example #1
0
 def test_not_node_2(self):
     node = 'something-else'
     self.assertEqual(soft_get(node, 'string'), '<SUB-ELEMENT>')
Example #2
0
 def test_not_callable(self):
     node = MagicMock()
     node.soft_get = 'foo'
     self.assertEqual(soft_get(node, 'string'), '<SUB-ELEMENT>')
Example #3
0
 def test_not_node_1(self):
     node = {'soft_get': lambda attr: attr}
     self.assertEqual(soft_get(node, 'string'), '<SUB-ELEMENT>')
Example #4
0
 def test_node(self):
     node = MagicMock()
     node.soft_get = lambda attr: attr
     self.assertEqual(soft_get(node, 'string'), 'string')