群集配置数据库

weepo的Python项目详细描述


群集配置数据库

先决条件

警告

只测试了Ubuntu 14.04其他平台可能工作,也可能不工作

MongoDB:

$ sudo apt-get mongodb python3-pip
$ sudo pip3 install --upgrade mongo

安装

来自PIP3:

$ pip3 install --upgrade weepo

来源:

$ python3 setup.py --quiet install

初学者用法

配置文件

高级用法

用法示例

  1. 编写测试用例:
importpitestclassMyTestCase(pitest.TestCase):# By default, test methods are methods whose names start with 'test_'. You# can change the matching patterns by defining the 'test_patterns' class# variable by uncommenting the following line:#       test_patterns = [ 'mytest_*', 'yourtest_*' ]# The start * means it matches anything, just like the command line glob.# If test methods have inter-dependencies, i.e., certain tests must precede# some other tests, you can define the dependencies using the# '_internal_deps' class variable. Here is an example:#       _internal_deps = { 'test_foo1': [ 'test_bar1*', 'test_bar2*' ],#                          'test_hel*lo': [ 'test_no', 'test_yes*' ],#                        }# If this test case depend on other test cases, you can specify their# dependencies via the 'deps' class variable. Here is an example:#       deps = [ 'MyTestCase1', 'MyTestCaseFoo*', ]# When you reference other test cases, you do NOT need to import the files# that define the referenced test cases. But if they cannot be found by the# end of the day, error will occur.def__init__(self[,*args[,**kwargs]]):pass# Run once before running all test methods.defsetup_instance(self[,*args[,**kwargs]]):pass# Run once after running all test methods.defteardown_instance(self[,*args[,**kwargs]]):pass# Run once before running every single test method.defsetup(self[,*args[,**kwargs]]):pass# Run once after running every single test method.defteardown(self[,*args[,**kwargs]]):pass# Actual test methods, names matching 'test_patterns'.deftest_foo_something(self[,*args[,**kwargs]]):passdeftest_foo_something_else(self[,*args[,**kwargs]]):passdeftest_bar_something(self[,*args[,**kwargs]]):passdeftest_bar_something_else(self[,*args[,**kwargs]]):pass
  1. 写入参数文件
importpitest__pitest_main_default_args_name__='my_args'my_args=pitest.Args()my_args.set_method_args('__init__',args=('Anndee',),kwargs={'kwarg0':'KoolArg'})my_args.set_method_args('test',args=('naathing',),kwargs={'kwarg1':'at owl'})my_args2=pitest.Args()my_args2.set_method_args('__init__',args=('Bashii',),kwargs={'kwarg0':'KoolArg2'})my_args2.set_method_args('test',args=('naathing',),kwargs={'kwarg1':'at owlll'})
  1. 运行测试用例

发现测试:

$ python3 -m pitest discover (case | method | all)

运行测试:

$ python3 -m pitest run (case | method) name

扫描给定目录:

$ python3 -m pitest --start-dir some/dir ...

使用动态参数运行测试:

$ python3 -m pitest run case MyTestCase --args-file my_args.py

在文件中使用非默认参数对象:

$ python3 -m pitest run case MyTestCase --args-file my_args.py \
                                        --args-name my_args2

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何在表被注释到配置之前获取表的元数据?   java滚动条不会出现在JList上   java JOGL监视器GPU内存   java为什么要使用RecyclerView onDraw延迟   java定制Oppo Reno 2 Z CPH1951(手机型号)的固件(闪存文件)   java自定义线程池执行器   java如何解决发布版本中重复的jar条目[com/安卓/volley/R.class]?   java如何使用Bukkit API触发事件?   java在blazemeter jmeter RTE插件中使用ctrl+w输入   C#/Visual Studio的java JDT等价物   java为什么当maxread值很大而收到的消息数量很小时,卡夫卡消费者会无限期消费?   java游戏2。x:包含模板列表的绑定模型   带压缩的java日志旋转   运行时。exec用java运行程序读取它正在做什么