Ver código fonte

Unittest + Documentation update

master
Dirk Alders 3 anos atrás
pai
commit
b59246390f

BIN
_docs_/_downloads/e2fbca9180ad234c517493570f525e69/unittest.pdf Ver arquivo


+ 10
- 8
_docs_/index.html Ver arquivo

@@ -205,15 +205,16 @@ including the following information: (condition-method (str), transition-time (n
205 205
 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="ch">#!/usr/bin/env python</span>
206 206
 <span class="c1"># -*- coding: UTF-8 -*-</span>
207 207
 
208
+<span class="kn">import</span> <span class="nn">sys</span>
209
+<span class="n">sys</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;../..&#39;</span><span class="p">)</span>
208 210
 <span class="kn">import</span> <span class="nn">logging</span>
209 211
 <span class="kn">import</span> <span class="nn">os</span>
210
-<span class="kn">import</span> <span class="nn">sys</span>
211 212
 
212 213
 <span class="kn">import</span> <span class="nn">report</span>
213 214
 <span class="kn">import</span> <span class="nn">state_machine</span>
214 215
 
215
-<span class="n">logger</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s1">&#39;__example__&#39;</span><span class="p">)</span>
216
-<span class="n">report</span><span class="o">.</span><span class="n">stdoutLoggingConfigure</span><span class="p">(</span><span class="n">log_name_lvl</span><span class="o">=</span><span class="p">[(</span><span class="n">state_machine</span><span class="o">.</span><span class="n">logger_name</span><span class="p">,</span> <span class="s1">&#39;DEBUG&#39;</span><span class="p">),</span> <span class="p">(</span><span class="s1">&#39;__example__&#39;</span><span class="p">,</span> <span class="s1">&#39;DEBUG&#39;</span><span class="p">),</span> <span class="p">])</span>
216
+<span class="n">logger</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s1">&#39;root&#39;</span><span class="p">)</span>
217
+<span class="n">report</span><span class="o">.</span><span class="n">stdoutLoggingConfigure</span><span class="p">(</span><span class="n">log_name_lvl</span><span class="o">=</span><span class="p">[(</span><span class="s1">&#39;root&#39;</span><span class="p">,</span> <span class="s1">&#39;DEBUG&#39;</span><span class="p">),</span> <span class="p">])</span>
217 218
 
218 219
 
219 220
 <span class="k">class</span> <span class="nc">trafic_lights</span><span class="p">(</span><span class="n">state_machine</span><span class="o">.</span><span class="n">state_machine</span><span class="p">):</span>
@@ -253,11 +254,12 @@ including the following information: (condition-method (str), transition-time (n
253 254
     <span class="n">sm</span><span class="o">.</span><span class="n">work</span><span class="p">()</span>
254 255
 </pre></div>
255 256
 </div>
256
-<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">2020</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">28</span> <span class="mi">07</span><span class="p">:</span><span class="mi">09</span><span class="p">:</span><span class="mi">32</span><span class="p">,</span><span class="mi">803</span><span class="p">:</span> <span class="n">STATE_MACHINE</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">TraficLights</span><span class="p">:</span> <span class="n">State</span> <span class="n">change</span> <span class="p">(</span><span class="s1">&#39;__init__&#39;</span><span class="p">):</span> <span class="kc">None</span> <span class="o">-&gt;</span> <span class="s1">&#39;state_red&#39;</span>
257
-<span class="mi">2020</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">28</span> <span class="mi">07</span><span class="p">:</span><span class="mi">09</span><span class="p">:</span><span class="mi">33</span><span class="p">,</span><span class="mi">003</span><span class="p">:</span> <span class="n">__example__</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">TraficLights</span><span class="p">:</span> <span class="n">Pedestrian</span> <span class="n">gave</span> <span class="n">state</span> <span class="n">change</span> <span class="n">request</span><span class="o">.</span>
258
-<span class="mi">2020</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">28</span> <span class="mi">07</span><span class="p">:</span><span class="mi">09</span><span class="p">:</span><span class="mi">34</span><span class="p">,</span><span class="mi">003</span><span class="p">:</span> <span class="n">STATE_MACHINE</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">TraficLights</span><span class="p">:</span> <span class="n">State</span> <span class="n">change</span> <span class="p">(</span><span class="s1">&#39;condition_pedastrian_request&#39;</span><span class="p">):</span> <span class="s1">&#39;state_red&#39;</span> <span class="o">-&gt;</span> <span class="s1">&#39;state_green&#39;</span>
259
-<span class="mi">2020</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">28</span> <span class="mi">07</span><span class="p">:</span><span class="mi">09</span><span class="p">:</span><span class="mi">34</span><span class="p">,</span><span class="mi">004</span><span class="p">:</span> <span class="n">__example__</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">Callback</span> <span class="n">information</span><span class="p">:</span> <span class="n">Traffic</span> <span class="n">light</span> <span class="n">had</span> <span class="n">been</span> <span class="n">changed</span> <span class="n">to</span> <span class="n">green</span> <span class="n">caused</span> <span class="n">by</span> <span class="n">pedastrian</span> <span class="n">request</span>
260
-<span class="mi">2020</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">28</span> <span class="mi">07</span><span class="p">:</span><span class="mi">09</span><span class="p">:</span><span class="mi">37</span><span class="p">,</span><span class="mi">004</span><span class="p">:</span> <span class="n">STATE_MACHINE</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">TraficLights</span><span class="p">:</span> <span class="n">State</span> <span class="n">change</span> <span class="p">(</span><span class="s1">&#39;condition_true&#39;</span><span class="p">):</span> <span class="s1">&#39;state_green&#39;</span> <span class="o">-&gt;</span> <span class="s1">&#39;state_red&#39;</span>
257
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">07</span> <span class="mi">01</span><span class="p">:</span><span class="mi">36</span><span class="p">:</span><span class="mi">29</span><span class="p">,</span><span class="mi">619</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">state_machine</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">TraficLights</span><span class="p">:</span> <span class="n">State</span> <span class="n">change</span> <span class="p">(</span><span class="s1">&#39;__init__&#39;</span><span class="p">):</span> <span class="kc">None</span> <span class="o">-&gt;</span> <span class="s1">&#39;state_red&#39;</span>
258
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">07</span> <span class="mi">01</span><span class="p">:</span><span class="mi">36</span><span class="p">:</span><span class="mi">29</span><span class="p">,</span><span class="mi">819</span><span class="p">:</span> <span class="n">root</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">TraficLights</span><span class="p">:</span> <span class="n">Pedestrian</span> <span class="n">gave</span> <span class="n">state</span> <span class="n">change</span> <span class="n">request</span><span class="o">.</span>
259
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">07</span> <span class="mi">01</span><span class="p">:</span><span class="mi">36</span><span class="p">:</span><span class="mi">30</span><span class="p">,</span><span class="mi">819</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">state_machine</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">TraficLights</span><span class="p">:</span> <span class="n">State</span> <span class="n">change</span> <span class="p">(</span><span class="s1">&#39;condition_pedastrian_request&#39;</span><span class="p">):</span> <span class="s1">&#39;state_red&#39;</span> <span class="o">-&gt;</span> <span class="s1">&#39;state_green&#39;</span>
260
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">07</span> <span class="mi">01</span><span class="p">:</span><span class="mi">36</span><span class="p">:</span><span class="mi">30</span><span class="p">,</span><span class="mi">819</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">state_machine</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">Executing</span> <span class="n">callback</span> <span class="mi">0</span> <span class="o">-</span> <span class="n">logging</span><span class="o">.</span><span class="n">info</span>
261
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">07</span> <span class="mi">01</span><span class="p">:</span><span class="mi">36</span><span class="p">:</span><span class="mi">30</span><span class="p">,</span><span class="mi">819</span><span class="p">:</span> <span class="n">root</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">Callback</span> <span class="n">information</span><span class="p">:</span> <span class="n">Traffic</span> <span class="n">light</span> <span class="n">had</span> <span class="n">been</span> <span class="n">changed</span> <span class="n">to</span> <span class="n">green</span> <span class="n">caused</span> <span class="n">by</span> <span class="n">pedastrian</span> <span class="n">request</span>
262
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">07</span> <span class="mi">01</span><span class="p">:</span><span class="mi">36</span><span class="p">:</span><span class="mi">33</span><span class="p">,</span><span class="mi">819</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">state_machine</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">TraficLights</span><span class="p">:</span> <span class="n">State</span> <span class="n">change</span> <span class="p">(</span><span class="s1">&#39;condition_true&#39;</span><span class="p">):</span> <span class="s1">&#39;state_green&#39;</span> <span class="o">-&gt;</span> <span class="s1">&#39;state_red&#39;</span>
261 263
 </pre></div>
262 264
 </div>
263 265
 <dl class="method">

+ 1
- 1
_docs_/searchindex.js Ver arquivo

@@ -1 +1 @@
1
-Search.setIndex({docnames:["index"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,sphinx:55},filenames:["index.rst"],objects:{"":{state_machine:[0,0,0,"-"]},"state_machine.state_machine":{last_transition_condition:[0,2,1,""],last_transition_condition_was:[0,2,1,""],previous_state:[0,2,1,""],previous_state_duration:[0,2,1,""],previous_state_was:[0,2,1,""],register_state_change_callback:[0,2,1,""],this_state:[0,2,1,""],this_state_duration:[0,2,1,""],this_state_is:[0,2,1,""],work:[0,2,1,""]},state_machine:{state_machine:[0,1,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method"},terms:{"boolean":0,"class":0,"default":0,"float":0,"import":0,"long":0,"new":0,"return":0,"true":0,"while":0,The:0,These:0,__example__:0,__init__:0,__log_lvl__:0,activ:0,addit:0,alder:0,all:0,allow:0,also:0,arg:0,argument:0,author:0,been:0,bin:0,bool:0,calcul:0,callback:0,can:0,caus:0,chang:0,check:0,code:0,condit:0,condition_pedastrian_request:0,condition_tru:0,content:0,creat:0,current:0,cyclicli:0,debug:0,def:0,default_st:0,defin:0,deriv:0,descript:0,dictionari:0,dirk:0,each:0,els:0,enabl:0,env:0,equival:0,exampl:0,execut:0,fals:0,follow:0,from:0,gave:0,getlogg:0,give:0,given:0,green:0,had:0,help:0,how:0,implement:0,includ:0,index:0,info:0,inform:0,initialis:0,instanc:0,kei:0,keyword:0,kwarg:0,last:0,last_transition_condit:0,last_transition_condition_wa:0,level:0,light:0,list:0,log:0,log_lvl:0,log_name_lvl:0,log_prefix:0,loge:0,logger:0,logger_nam:0,mean:0,method:0,mockeri:0,modul:0,mount:0,need:0,none:0,number:0,overrid:0,page:0,paramet:0,part:0,pedastrian:0,pedastrian_request:0,pedestrian:0,previou:0,previous:0,previous_st:0,previous_state_dur:0,previous_state_wa:0,python:0,regist:0,register_state_change_callback:0,report:0,request:0,respons:0,search:0,see:0,self:0,set:0,set_padestrian_request:0,start:0,state_green:0,state_r:0,stdoutloggingconfigur:0,store:0,str:0,submodul:0,sudo:0,support:0,sys:0,target:0,target_st:0,thi:0,this_stat:0,this_state_dur:0,this_state_i:0,time:0,traffic:0,trafic_light:0,traficlight:0,transit:0,tupl:0,type:0,unittest:0,used:0,useful:0,usr:0,utf:0,variabl:0,varibl:0,well:0,where:0,which:0,work:0},titles:["Welcome to state_machine\u2019s documentation!"],titleterms:{document:0,indic:0,machin:0,state:0,state_machin:0,tabl:0,welcom:0}})
1
+Search.setIndex({docnames:["index"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,sphinx:55},filenames:["index.rst"],objects:{"":{state_machine:[0,0,0,"-"]},"state_machine.state_machine":{last_transition_condition:[0,2,1,""],last_transition_condition_was:[0,2,1,""],previous_state:[0,2,1,""],previous_state_duration:[0,2,1,""],previous_state_was:[0,2,1,""],register_state_change_callback:[0,2,1,""],this_state:[0,2,1,""],this_state_duration:[0,2,1,""],this_state_is:[0,2,1,""],work:[0,2,1,""]},state_machine:{state_machine:[0,1,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method"},terms:{"boolean":0,"class":0,"default":0,"float":0,"import":0,"long":0,"new":0,"return":0,"true":0,"while":0,The:0,These:0,__init__:0,__log_lvl__:0,activ:0,addit:0,alder:0,all:0,allow:0,also:0,append:0,arg:0,argument:0,author:0,been:0,bin:0,bool:0,calcul:0,callback:0,can:0,caus:0,chang:0,check:0,code:0,condit:0,condition_pedastrian_request:0,condition_tru:0,content:0,creat:0,current:0,cyclicli:0,debug:0,def:0,default_st:0,defin:0,deriv:0,descript:0,dictionari:0,dirk:0,each:0,els:0,enabl:0,env:0,equival:0,exampl:0,execut:0,fals:0,follow:0,from:0,gave:0,getlogg:0,give:0,given:0,green:0,had:0,help:0,how:0,implement:0,includ:0,index:0,info:0,inform:0,initialis:0,instanc:0,kei:0,keyword:0,kwarg:0,last:0,last_transition_condit:0,last_transition_condition_wa:0,level:0,light:0,list:0,log:0,log_lvl:0,log_name_lvl:0,log_prefix:0,loge:0,logger:0,mean:0,method:0,mockeri:0,modul:0,mount:0,need:0,none:0,number:0,overrid:0,page:0,paramet:0,part:0,path:0,pedastrian:0,pedastrian_request:0,pedestrian:0,previou:0,previous:0,previous_st:0,previous_state_dur:0,previous_state_wa:0,python:0,regist:0,register_state_change_callback:0,report:0,request:0,respons:0,root:0,search:0,see:0,self:0,set:0,set_padestrian_request:0,start:0,state_green:0,state_r:0,stdoutloggingconfigur:0,store:0,str:0,submodul:0,sudo:0,support:0,sys:0,target:0,target_st:0,thi:0,this_stat:0,this_state_dur:0,this_state_i:0,time:0,traffic:0,trafic_light:0,traficlight:0,transit:0,tupl:0,type:0,unittest:0,used:0,useful:0,usr:0,utf:0,variabl:0,varibl:0,well:0,where:0,which:0,work:0},titles:["Welcome to state_machine\u2019s documentation!"],titleterms:{document:0,indic:0,machin:0,state:0,state_machin:0,tabl:0,welcom:0}})

+ 4512
- 4512
_testresults_/unittest.json
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


BIN
_testresults_/unittest.pdf Ver arquivo


Carregando…
Cancelar
Salvar