Did I find the right examples for you? yes no

All Samples(95)  |  Call(95)  |  Derive(0)  |  Import(0)
Check that the expression is true.

src/p/l/plexnet-HEAD/third_party/python/Cython/Compiler/Tests/TestTreeFragment.py   plexnet(Download)
    def test_substitutions_are_copied(self):
        T = self.fragment(u"y + y").substitute({"y": NameNode(pos=None, name="x")})
        self.assertEqual("x", T.stats[0].expr.operand1.name)
        self.assertEqual("x", T.stats[0].expr.operand2.name)
        self.assert_(T.stats[0].expr.operand1 is not T.stats[0].expr.operand2)
    def test_exprstat(self):
        F = self.fragment(u"PASS")
        pass_stat = PassStatNode(pos=None)
        T = F.substitute({"PASS" : pass_stat})
        self.assert_(isinstance(T.stats[0], PassStatNode), T)
        T = F.substitute(temps=[u"TMP"])
        s = T.body.stats
        self.assert_(isinstance(s[0].expr, TempRefNode))
        self.assert_(isinstance(s[1].rhs, TempRefNode))
        self.assert_(s[0].expr.handle is s[1].rhs.handle)

src/c/y/Cython-0.20.1/Cython/Compiler/Tests/TestTreeFragment.py   Cython(Download)
    def test_substitutions_are_copied(self):
        T = self.fragment(u"y + y").substitute({"y": NameNode(pos=None, name="x")})
        self.assertEqual("x", T.stats[0].expr.operand1.name)
        self.assertEqual("x", T.stats[0].expr.operand2.name)
        self.assert_(T.stats[0].expr.operand1 is not T.stats[0].expr.operand2)
    def test_exprstat(self):
        F = self.fragment(u"PASS")
        pass_stat = PassStatNode(pos=None)
        T = F.substitute({"PASS" : pass_stat})
        self.assert_(isinstance(T.stats[0], PassStatNode), T)
        T = F.substitute(temps=[u"TMP"])
        s = T.body.stats
        self.assert_(isinstance(s[0].expr, TempRefNode))
        self.assert_(isinstance(s[1].rhs, TempRefNode))
        self.assert_(s[0].expr.handle is s[1].rhs.handle)

src/c/y/cython-HEAD/Cython/Compiler/Tests/TestTreeFragment.py   cython(Download)
    def test_substitutions_are_copied(self):
        T = self.fragment(u"y + y").substitute({"y": NameNode(pos=None, name="x")})
        self.assertEqual("x", T.stats[0].expr.operand1.name)
        self.assertEqual("x", T.stats[0].expr.operand2.name)
        self.assert_(T.stats[0].expr.operand1 is not T.stats[0].expr.operand2)
    def test_exprstat(self):
        F = self.fragment(u"PASS")
        pass_stat = PassStatNode(pos=None)
        T = F.substitute({"PASS" : pass_stat})
        self.assert_(isinstance(T.stats[0], PassStatNode), T)
        T = F.substitute(temps=[u"TMP"])
        s = T.body.stats
        self.assert_(isinstance(s[0].expr, TempRefNode))
        self.assert_(isinstance(s[1].rhs, TempRefNode))
        self.assert_(s[0].expr.handle is s[1].rhs.handle)

src/c/y/CythonCTypesBackend-HEAD/Cython/Compiler/Tests/TestTreeFragment.py   CythonCTypesBackend(Download)
    def test_substitutions_are_copied(self):
        T = self.fragment(u"y + y").substitute({"y": NameNode(pos=None, name="x")})
        self.assertEqual("x", T.stats[0].expr.operand1.name)
        self.assertEqual("x", T.stats[0].expr.operand2.name)
        self.assert_(T.stats[0].expr.operand1 is not T.stats[0].expr.operand2)
    def test_exprstat(self):
        F = self.fragment(u"PASS")
        pass_stat = PassStatNode(pos=None)
        T = F.substitute({"PASS" : pass_stat})
        self.assert_(isinstance(T.stats[0], PassStatNode), T)
        T = F.substitute(temps=[u"TMP"])
        s = T.body.stats
        self.assert_(isinstance(s[0].expr, TempRefNode))
        self.assert_(isinstance(s[1].rhs, TempRefNode))
        self.assert_(s[0].expr.handle is s[1].rhs.handle)

src/e/s/essig-HEAD/vm/cython/Cython/Compiler/Tests/TestTreeFragment.py   essig(Download)
    def test_substitutions_are_copied(self):
        T = self.fragment(u"y + y").substitute({"y": NameNode(pos=None, name="x")})
        self.assertEqual("x", T.stats[0].expr.operand1.name)
        self.assertEqual("x", T.stats[0].expr.operand2.name)
        self.assert_(T.stats[0].expr.operand1 is not T.stats[0].expr.operand2)
    def test_exprstat(self):
        F = self.fragment(u"PASS")
        pass_stat = PassStatNode(pos=None)
        T = F.substitute({"PASS" : pass_stat})
        self.assert_(isinstance(T.stats[0], PassStatNode), T)
        T = F.substitute(temps=[u"TMP"])
        s = T.stats
        self.assert_(s[0].expr.name == "__tmpvar_1")
#        self.assert_(isinstance(s[0].expr, TempRefNode))
#        self.assert_(isinstance(s[1].rhs, TempRefNode))

src/p/y/pylibs-HEAD/Cython/Compiler/Tests/TestTreeFragment.py   pylibs(Download)
    def test_substitutions_are_copied(self):
        T = self.fragment(u"y + y").substitute({"y": NameNode(pos=None, name="x")})
        self.assertEqual("x", T.stats[0].expr.operand1.name)
        self.assertEqual("x", T.stats[0].expr.operand2.name)
        self.assert_(T.stats[0].expr.operand1 is not T.stats[0].expr.operand2)
    def test_exprstat(self):
        F = self.fragment(u"PASS")
        pass_stat = PassStatNode(pos=None)
        T = F.substitute({"PASS" : pass_stat})
        self.assert_(isinstance(T.stats[0], PassStatNode), T)
        T = F.substitute(temps=[u"TMP"])
        s = T.stats
        self.assert_(s[0].expr.name == "__tmpvar_1")
#        self.assert_(isinstance(s[0].expr, TempRefNode))
#        self.assert_(isinstance(s[1].rhs, TempRefNode))

src/p/l/plexnet-HEAD/third_party/python/Cython/Compiler/Tests/TestBuffer.py   plexnet(Download)
    def test_basic(self):
        t = self.parse(u"cdef object[float, 4, ndim=2, foo=foo] x")
        bufnode = t.stats[0].base_type
        self.assert_(isinstance(bufnode, CBufferAccessTypeNode))
        self.assertEqual(2, len(bufnode.positional_args))
    def nonfatal_error(self, error):
        # We're passing self as context to transform to trap this
        self.error = error
        self.assert_(self.expect_error)
 
            assert isinstance(vardef, CVarDefNode) # use normal assert as this is to validate the test code
            buftype = vardef.base_type
            self.assert_(isinstance(buftype, CBufferAccessTypeNode))
            self.assert_(isinstance(buftype.base_type_node, CSimpleBaseTypeNode))
            self.assertEqual(u"object", buftype.base_type_node.name)
            return buftype
        else:
            self.assert_(len(root.stats[0].body.stats) == 0)

src/e/s/essig-HEAD/vm/cython/Cython/Compiler/Tests/TestBuffer.py   essig(Download)
    def test_basic(self):
        t = self.parse(u"cdef object[float, 4, ndim=2, foo=foo] x")
        bufnode = t.stats[0].base_type
        self.assert_(isinstance(bufnode, TemplatedTypeNode))
        self.assertEqual(2, len(bufnode.positional_args))
    def nonfatal_error(self, error):
        # We're passing self as context to transform to trap this
        self.error = error
        self.assert_(self.expect_error)
 
            assert isinstance(vardef, CVarDefNode) # use normal assert as this is to validate the test code
            buftype = vardef.base_type
            self.assert_(isinstance(buftype, TemplatedTypeNode))
            self.assert_(isinstance(buftype.base_type_node, CSimpleBaseTypeNode))
            self.assertEqual(u"object", buftype.base_type_node.name)
            return buftype
        else:
            self.assert_(len(root.stats[0].body.stats) == 0)

src/c/y/Cython-0.20.1/Cython/Compiler/Tests/TestBuffer.py   Cython(Download)
    def test_basic(self):
        t = self.parse(u"cdef object[float, 4, ndim=2, foo=foo] x")
        bufnode = t.stats[0].base_type
        self.assert_(isinstance(bufnode, TemplatedTypeNode))
        self.assertEqual(2, len(bufnode.positional_args))
    def nonfatal_error(self, error):
        # We're passing self as context to transform to trap this
        self.error = error
        self.assert_(self.expect_error)
 
            assert isinstance(vardef, CVarDefNode) # use normal assert as this is to validate the test code
            buftype = vardef.base_type
            self.assert_(isinstance(buftype, TemplatedTypeNode))
            self.assert_(isinstance(buftype.base_type_node, CSimpleBaseTypeNode))
            self.assertEqual(u"object", buftype.base_type_node.name)
            return buftype
        else:
            self.assert_(len(root.stats[0].body.stats) == 0)

src/c/y/cython-HEAD/Cython/Compiler/Tests/TestBuffer.py   cython(Download)
    def test_basic(self):
        t = self.parse(u"cdef object[float, 4, ndim=2, foo=foo] x")
        bufnode = t.stats[0].base_type
        self.assert_(isinstance(bufnode, TemplatedTypeNode))
        self.assertEqual(2, len(bufnode.positional_args))
    def nonfatal_error(self, error):
        # We're passing self as context to transform to trap this
        self.error = error
        self.assert_(self.expect_error)
 
            assert isinstance(vardef, CVarDefNode) # use normal assert as this is to validate the test code
            buftype = vardef.base_type
            self.assert_(isinstance(buftype, TemplatedTypeNode))
            self.assert_(isinstance(buftype.base_type_node, CSimpleBaseTypeNode))
            self.assertEqual(u"object", buftype.base_type_node.name)
            return buftype
        else:
            self.assert_(len(root.stats[0].body.stats) == 0)

  1 | 2  Next