!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.29%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


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


import test_helper

from Ft.Server.Common import DocumentReference, ResourceTypes

def test_create_raw_file(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='xml'/>
  <xsl:template match="/">
    <bar>Foo</bar>
    <fcore:create-raw-file path='rf1' imt='text/jpg'>
      <xsl:text>RAW</xsl:text>
    </fcore:create-raw-file>
  </xsl:template>
</xsl:stylesheet>"""

    expected = """<?xml version='1.0' encoding='UTF-8'?>\n<bar>Foo</bar>"""

    tester.startTest("XSLT Extension Create Raw File")

    repo = test_helper.GetRepo(tester)

    test = repo.fetchResource('test')
    test_helper.TestXslt(tester,test,sty,expected)
    tester.compare(ResourceTypes.ResourceType.RAW_FILE,test.hasResource('rf1'))
    tester.compare('text/jpg',test.fetchResource('rf1').getImt())
    repo.txCommit()

    tester.testDone()


def test_create_document(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='xml'/>
  <xsl:template match="/">
    <bar>Foo</bar>
    <fcore:create-document path='doc1'>
      <foo/>
    </fcore:create-document>
  </xsl:template>
</xsl:stylesheet>"""

    expected = """<?xml version='1.0' encoding='UTF-8'?>\n<bar>Foo</bar>"""

    tester.startTest("XSLT Extension Create Document")

    repo = test_helper.GetRepo(tester)

    test = repo.fetchResource('test')
    test_helper.TestXslt(tester,test,sty,expected)
    tester.compare(ResourceTypes.ResourceType.XML_DOCUMENT,test.hasResource('doc1'))
    repo.txCommit()

    tester.testDone()

def test_has_resource(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:has-resource("/test")'/>
  </xsl:template>
</xsl:stylesheet>"""

    expected = """%d""" % ResourceTypes.ResourceType.CONTAINER

    tester.startTest("XSLT Extension Has Resource")

    repo = test_helper.GetRepo(tester)

    test = repo.fetchResource('test')
    test_helper.TestXslt(tester,test,sty,expected)
    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()
    
    repo.createContainer('test')
    repo.txCommit()
    tester.testDone()




def Test(tester):


    cleanup(tester)
    test_create_raw_file(tester)
    test_create_document(tester)
    test_has_resource(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.0039 ]--