Trees | Indices | Help |
|
---|
|
1 # coding: utf8 2 # 3 # Project: The EDNA Kernel 4 # http://www.edna-site.org 5 # 6 # File: "$Id: EDTestCaseParallelExecute.py 2128 2010-10-04 16:39:42Z kieffer $" 7 # 8 # Copyright (C) 2008-2010 European Synchrotron Radiation Facility 9 # Grenoble, France 10 # 11 # Principal authors: Jérôme Kieffer (kieffer@esrf.fr) 12 # 13 # 14 # This program is free software: you can redistribute it and/or modify 15 # it under the terms of the GNU Lesser General Public License as published 16 # by the Free Software Foundation, either version 3 of the License, or 17 # (at your option) any later version. 18 # 19 # This program is distributed in the hope that it will be useful, 20 # but WITHOUT ANY WARRANTY; without even the implied warranty of 21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 # GNU Lesser General Public License for more details. 23 # 24 # You should have received a copy of the GNU General Public License 25 # and the GNU Lesser General Public License along with this program. 26 # If not, see <http://www.gnu.org/licenses/>. 27 # 28 29 __authors__ = ["Jérôme Kieffer"] 30 __contact__ = "Jerome.Kieffer@esrf.eu" 31 __license__ = "LGPLv3+" 32 __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" 33 34 import os, sys, math, distutils.util 35 from EDVerbose import EDVerbose 36 from EDTestCase import EDTestCase 37 from EDAssert import EDAssert 38 from EDUtilsPlatform import EDUtilsPlatform 39 40 4143 """ 44 Unit & execution test for the EDUtilsPlatform static class 45 """ 46 49 50106 107 if __name__ == '__main__': 108 109 edTestCaseEDUtils = EDTestCaseEDUtilsUnit("EDTestCaseEDUtilsUnit") 110 edTestCaseEDUtils.execute() 11152 """ 53 Test os.name 54 """ 55 EDVerbose.DEBUG("EDTestCaseEDUtilsPlatform.unitTestName") 56 if os.name != "java": 57 EDAssert.equal(os.name, EDUtilsPlatform.name, "os.name equivalent") 58 else: 59 EDAssert.equal(True, EDUtilsPlatform.name in ["posix", "nt"], "os.name equivalent")60 6163 """ 64 Test os.linesep 65 """ 66 EDVerbose.DEBUG("EDTestCaseEDUtilsPlatform.unitTestLineSep") 67 EDAssert.equal(os.linesep, EDUtilsPlatform.linesep, "os.linesep equivalent")68 6971 """ 72 Test os.sep 73 """ 74 EDVerbose.DEBUG("EDTestCaseEDUtilsPlatform.unitTestSep") 75 EDAssert.equal(os.sep, EDUtilsPlatform.sep, "os.sep equivalent")76 7779 """ 80 Test architecture and size 81 """ 82 EDVerbose.DEBUG("EDTestCaseEDUtilsPlatform.unitTestArchSize") 83 if EDUtilsPlatform.size == 64: 84 EDAssert.equal(distutils.util.get_platform(), EDUtilsPlatform.getPythonPlatform(), "distutil.util.get_platform") 85 else: 86 EDAssert.equal(distutils.util.get_platform(), EDUtilsPlatform.getSystemPlatform(), "distutil.util.get_platform")87 8890 """ 91 Test architecture and size 92 """ 93 EDVerbose.DEBUG("EDTestCaseEDUtilsPlatform.unitTestEscapedLineSep") 94 if EDUtilsPlatform.name == "posix": 95 EDAssert.equal("\\n", EDUtilsPlatform.escapedLinesep, "escapedLineSep") 96 else: 97 EDAssert.equal("\\r\\n", EDUtilsPlatform.escapedLinesep, "escapedLineSep")98 99101 self.addTestMethod(self.unitTestName) 102 self.addTestMethod(self.unitTestLineSep) 103 self.addTestMethod(self.unitTestSep) 104 self.addTestMethod(self.unitTestArchSize) 105 self.addTestMethod(self.unitTestEscapedLineSep)
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Jun 20 03:53:32 2014 | http://epydoc.sourceforge.net |