Beispiel #1
0
    def test_read_node_contents(self):
        test_fh = open('/etc/passwd')
        selector = StaticSelector(projection='', contentfile_path=test_fh.name)
        abs_node = AbstractNode(selector=selector)
        node = mocksignature(Node, Node)
        node.is_leaf = True

        contents = abs_node.read_node_contents(node)

        self.assertIsInstance(contents, str)
        self.assertEqual(contents, test_fh.read())
Beispiel #2
0
    def test_read_node_contents(self):
        abs_node = AbstractNode(selector=StaticSelector(''))
        abs_node.read_node_contents = lambda node: open('/etc/passwd').read()
        node = mocksignature(Node, Node)

        self.assertIsInstance(abs_node.read_node_contents(node), str)