logo      
Custom Search

SF.net SVN: jython: [3035] trunk/jython/Lib/test/test_sax.py

Date: December 31, 2006
From: cgroves@xxxxxxxxxxxxxxxxxxxxx

Revision: 3035
          http://svn.sourceforge.net/jython/?rev=3035&view=rev
Author:   cgroves
Date:     2006-12-31 13:16:52 -0800 (Sun, 31 Dec 2006)

Log Message:
-----------
swap \ for / in the path for checking against system id since its a URL

Modified Paths:
--------------
    trunk/jython/Lib/test/test_sax.py

Modified: trunk/jython/Lib/test/test_sax.py
===================================================================
--- trunk/jython/Lib/test/test_sax.py   2006-12-31 21:16:10 UTC (rev 3034)
+++ trunk/jython/Lib/test/test_sax.py   2006-12-31 21:16:52 UTC (rev 3035)
@@ -470,9 +470,16 @@
     xmlgen = LocatorTest(result)
     parser = make_parser()
     parser.setContentHandler(xmlgen)
-    parser.parse(findfile("test.xml"))
+    testfile = findfile("test.xml")
+    parser.parse(testfile)
+    #In Jython, the system id is a URL with forward slashes, and under Windows
+    #findfile returns a path with backslashes, so replace the backslashes with
+    #forward
+    import os
+    if os.name == 'java':
+       testfile = testfile.replace('\\', '/')
 
-    return xmlgen.location.getSystemId().endswith(findfile("test.xml")) and \
+    return xmlgen.location.getSystemId().endswith(testfile) and \
            xmlgen.location.getPublicId() is None
 
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV



Custom Search