!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/Server/Server/Xslt/   drwxr-xr-x
Free 1.7 GB of 27.03 GB (6.28%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     test_resource_metadata.py (2.5 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |


import test_helper

from Ft.Server.Common import DocumentReference, ResourceTypes

from Ft.Xml.Lib import TreeCompare

def test_get_content(tester):

    sty = """<?xml version="1.0"?>
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  xmlns:fcore='http://xmlns.4suite.org/4ss/score'
  extension-element-prefixes="fcore"
  >
  <xsl:output method='text'/>
  <xsl:template match="/">
    <xsl:value-of select='fcore:get-content("rf1")'/>
  </xsl:template>
</xsl:stylesheet>"""

    expected = """RAW1"""

    tester.startTest("XSLT Extension Get Content")

    repo = test_helper.GetRepo(tester)
    test = repo.fetchResource('test')
    test_helper.TestXslt(tester,test,sty,expected)
    repo.txCommit()

    tester.testDone()


def test_set_content(tester):

    sty_base = """<?xml version="1.0"?>
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  xmlns:fcore='http://xmlns.4suite.org/4ss/score'
  extension-element-prefixes="fcore"
  >
  <xsl:output method='%s'/>
  <xsl:template match="/">
    <xsl:text>Foo</xsl:text>
    <fcore:set-content path='%s' literal-content='yes'>
    %s
    </fcore:set-content>
  </xsl:template>
</xsl:stylesheet>"""


    tester.startTest("XSLT Extension Set Content on raw file")
    expected = """Foo"""
    sty = sty_base % ('text',"rf1","<xsl:text>RAW2</xsl:text>")
    repo = test_helper.GetRepo(tester)

    test = repo.fetchResource('test')
    test_helper.TestXslt(tester,test,sty,expected)
    tester.compare("RAW2",test.fetchResource('rf1').getContent())
    repo.txCommit()
    tester.testDone()


    tester.startTest("XSLT Extension Set Content on xml document")
    repo = test_helper.GetRepo(tester)
    sty = sty_base % ('xml',"doc1","<foo2/>")
    expected = '<?xml version="1.0" encoding="UTF-8"?>\n<foo2/>'
    test = repo.fetchResource('test')
    test_helper.TestXslt(tester,test,sty,"<?xml version='1.0' encoding='UTF-8'?>\nFoo")
    tester.compare(expected,test.fetchResource('doc1').getContent(),func=TreeCompare.TreeCompare)
    repo.txCommit()

    tester.testDone()




def cleanup(tester):

    tester.startTest("Clean Up")
    repo = test_helper.GetRepo(tester)
    if repo.hasResource('/test'):
        t = repo.fetchResource('/test')
        t.delete()

    test = repo.createContainer('test')
    test.createRawFile('rf1','text/plain','RAW1')
    test.createDocument('doc1','<foo/>')
    repo.txCommit()
    tester.testDone()




def Test(tester):

    cleanup(tester)
    test_get_content(tester)
    test_set_content(tester)

:: 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.007 ]--