def main():
usage = 'test - check file types and compare values'
parser = argparse.ArgumentParser(usage)
parser.add_argument('-b', action='store_true', default=False, help='FILE exists and is block special')
parser.add_argument('-c', action='store_true', default=False, help='FILE exists and is character special')
parser.add_argument('-d', action='store_true', default=False, help='FILE exists and is a directory')
parser.add_argument('-e', action='store_true', default=False, help='FILE exists')
parser.add_argument('-f', action='store_true', default=False, help='FILE exists and is a regular file')
parser.add_argument('-g', action='store_true', default=False, help='FILE exists and is set-group-ID')
parser.add_argument('-G', action='store_true', default=False, help='FILE exists and is owned by the effective group ID')
#-h
parser.add_argument('-k', action='store_true', default=False, help='FILE exists and has its sticky bit set')
parser.add_argument('-L', action='store_true', default=False, help='FILE exists and is a symbolic link')
#parser.add_argument('-o', action='store_true', default=False, help='FILE exists and is owned by the effective user ID')
parser.add_argument('-p', action='store_true', default=False, help='FILE exists and is a named pipe')
parser.add_argument('-r', action='store_true', default=False, help='FILE exists and read permission is granted')
# -s
parser.add_argument('-S', action='store_true', default=False, help='FILE exists and is a socket')
# -t
parser.add_argument('-u', action='store_true', default=False, help='FILE exists and its set-user-ID bit is set')
parser.add_argument('-w', action='store_true', default=False, help='FILE exists and write permission is granted')
parser.add_argument('-x', action='store_true', default=False, help='FILE exists and execute (or search) permission is granted')
parser.add_argument('-z', action='store_true', default=False, help='the length of STRING is zero')
# two file
group = parser.add_mutually_exclusive_group()
group.add_argument("-nt", action="store_true", help='FILE1 and FILE2 have the same device and inode numbers')
group.add_argument("-ot", action="store_true", help='FILE1 is newer (modification date) than FILE2')
group.add_argument("-eq", action="store_true", help='INTEGER1 is equal to INTEGER2')
group.add_argument("-ge", action="store_true", help='INTEGER1 is greater than or equal to INTEGER2')
group.add_argument("-gt", action="store_true", help='INTEGER1 is greater than INTEGER2')
group.add_argument("-le", action="store_true", help='INTEGER1 is less than or equal to INTEGER2')
group.add_argument("-lt", action="store_true", help='INTEGER1 is less than INTEGER2')
group.add_argument("-ne", action="store_true", help='INTEGER1 is not equal to INTEGER2')
#group.add_argument("-ef", "--ef", action="store_true", help='FILE1 and FILE2 have the same device and inode numbers')
group.add_argument("-a", action="store_true", help='both EXPRESSION1 and EXPRESSION2 are true')
# group.add_argument("-o", "--o", action="store_true", help='either EXPRESSION1 or EXPRESSION2 is true')
分享到:
相关推荐
Amber Python Test.zip
//传递参数时,每个参数中间要有一个空格 //Python接收参数的方法: //从1开始接收参数 //args1= sys.argv[1] //args2=sys.argv[2] //args2=sys.argv[3]
E:\My Documents\Visual Studio Projects\PythonTest\PythonTest.rar
python test 回归函数
test python programming language
Python Unit Test Automation will allow you to quickly ramp up your understanding of unit test libraries for Python 3 through the practical use of code examples and exercises. All of which makes this ...
Python Unit Test Automation will allow you to quickly ramp up your understanding of unit test libraries for Python 3 through the practical use of code examples and exercises. All of which makes this ...
python自动生成Verilog的testbench脚本。python自动生成Verilog的testbench脚本。python自动生成Verilog的testbench脚本。
python test ''' Created on 2011-11-2 @author: ACER ''' import glob, os from testframe.TestSuite import * class PyTestRunner: @staticmethod def run(suite): TestSuite.run(suite) @staticmethod ...
pythontest.zip
python学习中的笔记源码,可以根据1-8.2的笔记来看,一一对应,希望可以对python初学者有点帮助,有源码有注释
NULL 博文链接:https://love2java.iteye.com/blog/1543204
资源分类:Python库 所属语言:Python 资源全名:test_tube-0.6.7.1.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
ps_demo_python_test
PS_python_test.002
Python
python test:一些python安装和人脸识别的东西。python学习笔记
python API接口测试工具(转),学习使用。python API接口测试工具(转),学习使用。python API接口测试工具(转),学习使用。https://www.jianshu.com/p/90adb21844bd?tdsourcetag=s_pcqq_aiomsg
pythontest_8.30.py