!C99Shell v. 1.0 pre-release build #16!

Software: Apache/2.0.54 (Fedora). PHP/5.0.4 

uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 

uid=48(apache) gid=48(apache) groups=48(apache)
context=system_u:system_r:httpd_sys_script_t
 

Safe-mode: OFF (not secure)

/usr/lib/4Suite/tests/Xml/XPath/Core/   drwxr-xr-x
Free 8.37 GB of 27.03 GB (30.96%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     test_predicate_list.py (1.89 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
from Ft.Xml import Domlette
from xml.dom import Node

source_1 = """<?xml version="1.0"?>
<elementList>
    <element>
        <x>
            <y>a</y>
        </x>
    </element>
    <element>
        <x>
            <y>z</y>
        </x>
    </element>
</elementList>"""

def Test(tester):

    tester.startGroup('Predicate List')
    
    tester.startTest('Checking syntax')
    from Ft.Xml.XPath import ParsedPredicateList
    from Ft.Xml.XPath import ParsedExpr
    from Ft.Xml.XPath import Context
   from Ft.Xml.XPath import Evaluate
    import DummyExpr
    DomTree = tester.test_data['tree']
    tester.testDone()

    tester.startTest('Creating test environment')
    t = DummyExpr.DummyBooleanExpr(1)
    f = DummyExpr.DummyBooleanExpr(0)
    a = ParsedExpr.ParsedAndExpr(t,f)
    o = ParsedExpr.ParsedOrExpr(t,f)
    context = Context.Context(DomTree.ROOT,1,1)
    tester.testDone()
    
    p = ParsedPredicateList.ParsedPredicateList([a,t])
    tester.startTest('Filter of "%s"' % repr(p))
    result = p.filter([context.node], context, 0)
    tester.compare(0, len(result))
    tester.testDone()
    
    p = ParsedPredicateList.ParsedPredicateList([o,t])
    tester.startTest('Filter of "%s"' % repr(p))
    result = p.filter([context.node], context, 0)
    tester.compare([DomTree.ROOT], result)
    tester.testDone()

    dom = Domlette.NonvalidatingReader.parseString(source_1,'.')

    expected = filter(lambda x: x.nodeType == Node.ELEMENT_NODE,
                      dom.documentElement.childNodes)[-1]

    tests = [("//element[descendant::y[.='z']]", [expected]),
             ("//element[descendant::y[.='z']][1]", [expected]),
             ("//element[descendant::y[.='z']][2]", []),
             ]

    for (expr, expected) in tests:
        tester.startTest(expr)
        actual = Evaluate(expr, contextNode=dom)
        tester.compare(expected, actual)
        tester.testDone()

    return tester.groupDone()

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0034 ]--