bee_python 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (488) hide show
  1. data/{build/README → README} +1 -1
  2. data/egg/egg/build.yml +11 -49
  3. data/egg/egg.yml +19 -27
  4. data/egg/http/build.erb +32 -36
  5. data/egg/http/libhttp.py +102 -0
  6. data/egg/http/pylint.cfg +236 -0
  7. data/egg/http/server.py +7 -0
  8. data/egg/http/test.erb +32 -0
  9. data/egg/http.yml +33 -29
  10. data/egg/mysql/mysql.py +8 -9
  11. data/egg/project/build.erb +21 -53
  12. data/egg/project/pylint.cfg +236 -0
  13. data/egg/project/test.py +2 -2
  14. data/egg/project.yml +23 -31
  15. data/egg/script/build.erb +18 -23
  16. data/egg/script/pylint.cfg +236 -0
  17. data/egg/script.yml +22 -18
  18. data/egg/source/source.py +6 -6
  19. data/egg/test/test.py +1 -1
  20. data/lib/bee_task_python.rb +3 -34
  21. data/python.yml +123 -0
  22. metadata +61 -503
  23. data/test/build.yml +0 -16
  24. data/test/tc_bee_task_python.rb +0 -27
  25. data/test/test_build.rb +0 -26
  26. data/test/test_build_listener.rb +0 -110
  27. data/test/ts_bee_python.rb +0 -26
  28. data/tools/common/__init__.py +0 -5
  29. data/tools/common/common/__init__.py +0 -140
  30. data/tools/common/common/__pkginfo__.py +0 -43
  31. data/tools/common/common/adbh.py +0 -35
  32. data/tools/common/common/cache.py +0 -114
  33. data/tools/common/common/changelog.py +0 -234
  34. data/tools/common/common/clcommands.py +0 -181
  35. data/tools/common/common/cli.py +0 -212
  36. data/tools/common/common/compat.py +0 -328
  37. data/tools/common/common/configuration.py +0 -1087
  38. data/tools/common/common/contexts.py +0 -58
  39. data/tools/common/common/corbautils.py +0 -117
  40. data/tools/common/common/daemon.py +0 -171
  41. data/tools/common/common/date.py +0 -279
  42. data/tools/common/common/db.py +0 -49
  43. data/tools/common/common/dbf.py +0 -229
  44. data/tools/common/common/debugger.py +0 -208
  45. data/tools/common/common/decorators.py +0 -190
  46. data/tools/common/common/deprecation.py +0 -118
  47. data/tools/common/common/fileutils.py +0 -409
  48. data/tools/common/common/graph.py +0 -259
  49. data/tools/common/common/html.py +0 -142
  50. data/tools/common/common/interface.py +0 -76
  51. data/tools/common/common/logging_ext.py +0 -166
  52. data/tools/common/common/modutils.py +0 -670
  53. data/tools/common/common/optik_ext.py +0 -383
  54. data/tools/common/common/optparser.py +0 -92
  55. data/tools/common/common/pdf_ext.py +0 -111
  56. data/tools/common/common/proc.py +0 -276
  57. data/tools/common/common/pyro_ext.py +0 -146
  58. data/tools/common/common/pytest.py +0 -754
  59. data/tools/common/common/shellutils.py +0 -383
  60. data/tools/common/common/sphinx_ext.py +0 -87
  61. data/tools/common/common/sphinxutils.py +0 -122
  62. data/tools/common/common/sqlgen.py +0 -31
  63. data/tools/common/common/table.py +0 -930
  64. data/tools/common/common/tasksqueue.py +0 -97
  65. data/tools/common/common/test/__init__.py +0 -1
  66. data/tools/common/common/test/data/ChangeLog +0 -184
  67. data/tools/common/common/test/data/MyPyPa-0.1.0-py2.5.egg +0 -0
  68. data/tools/common/common/test/data/__init__.py +0 -1
  69. data/tools/common/common/test/data/content_differ_dir/NOTHING +0 -0
  70. data/tools/common/common/test/data/content_differ_dir/README +0 -1
  71. data/tools/common/common/test/data/content_differ_dir/subdir/coin +0 -1
  72. data/tools/common/common/test/data/content_differ_dir/subdir/toto.txt +0 -53
  73. data/tools/common/common/test/data/file_differ_dir/NOTHING +0 -0
  74. data/tools/common/common/test/data/file_differ_dir/README +0 -1
  75. data/tools/common/common/test/data/file_differ_dir/subdir/toto.txt +0 -53
  76. data/tools/common/common/test/data/file_differ_dir/subdirtwo/Hello +0 -0
  77. data/tools/common/common/test/data/find_test/__init__.py +0 -0
  78. data/tools/common/common/test/data/find_test/foo.txt +0 -0
  79. data/tools/common/common/test/data/find_test/module.py +0 -0
  80. data/tools/common/common/test/data/find_test/module2.py +0 -0
  81. data/tools/common/common/test/data/find_test/newlines.txt +0 -0
  82. data/tools/common/common/test/data/find_test/noendingnewline.py +0 -0
  83. data/tools/common/common/test/data/find_test/nonregr.py +0 -0
  84. data/tools/common/common/test/data/find_test/normal_file.txt +0 -0
  85. data/tools/common/common/test/data/find_test/spam.txt +0 -0
  86. data/tools/common/common/test/data/find_test/sub/doc.txt +0 -0
  87. data/tools/common/common/test/data/find_test/sub/momo.py +0 -0
  88. data/tools/common/common/test/data/find_test/test.ini +0 -0
  89. data/tools/common/common/test/data/find_test/test1.msg +0 -0
  90. data/tools/common/common/test/data/find_test/test2.msg +0 -0
  91. data/tools/common/common/test/data/find_test/write_protected_file.txt +0 -0
  92. data/tools/common/common/test/data/foo.txt +0 -9
  93. data/tools/common/common/test/data/module.py +0 -88
  94. data/tools/common/common/test/data/module2.py +0 -77
  95. data/tools/common/common/test/data/newlines.txt +0 -3
  96. data/tools/common/common/test/data/noendingnewline.py +0 -36
  97. data/tools/common/common/test/data/nonregr.py +0 -14
  98. data/tools/common/common/test/data/normal_file.txt +0 -0
  99. data/tools/common/common/test/data/reference_dir/NOTHING +0 -0
  100. data/tools/common/common/test/data/reference_dir/README +0 -1
  101. data/tools/common/common/test/data/reference_dir/subdir/coin +0 -1
  102. data/tools/common/common/test/data/reference_dir/subdir/toto.txt +0 -53
  103. data/tools/common/common/test/data/same_dir/NOTHING +0 -0
  104. data/tools/common/common/test/data/same_dir/README +0 -1
  105. data/tools/common/common/test/data/same_dir/subdir/coin +0 -1
  106. data/tools/common/common/test/data/same_dir/subdir/toto.txt +0 -53
  107. data/tools/common/common/test/data/spam.txt +0 -9
  108. data/tools/common/common/test/data/sub/doc.txt +0 -1
  109. data/tools/common/common/test/data/sub/momo.py +0 -1
  110. data/tools/common/common/test/data/subdir_differ_dir/NOTHING +0 -0
  111. data/tools/common/common/test/data/subdir_differ_dir/README +0 -1
  112. data/tools/common/common/test/data/subdir_differ_dir/subdir/coin +0 -1
  113. data/tools/common/common/test/data/subdir_differ_dir/subdir/toto.txt +0 -53
  114. data/tools/common/common/test/data/test.ini +0 -20
  115. data/tools/common/common/test/data/test1.msg +0 -30
  116. data/tools/common/common/test/data/test2.msg +0 -42
  117. data/tools/common/common/test/data/write_protected_file.txt +0 -0
  118. data/tools/common/common/test/foomod.py +0 -17
  119. data/tools/common/common/test/unittest_cache.py +0 -129
  120. data/tools/common/common/test/unittest_changelog.py +0 -37
  121. data/tools/common/common/test/unittest_compat.py +0 -239
  122. data/tools/common/common/test/unittest_configuration.py +0 -348
  123. data/tools/common/common/test/unittest_date.py +0 -154
  124. data/tools/common/common/test/unittest_decorators.py +0 -62
  125. data/tools/common/common/test/unittest_deprecation.py +0 -76
  126. data/tools/common/common/test/unittest_fileutils.py +0 -133
  127. data/tools/common/common/test/unittest_graph.py +0 -50
  128. data/tools/common/common/test/unittest_html.py +0 -76
  129. data/tools/common/common/test/unittest_interface.py +0 -87
  130. data/tools/common/common/test/unittest_modutils.py +0 -244
  131. data/tools/common/common/test/unittest_pytest.py +0 -50
  132. data/tools/common/common/test/unittest_shellutils.py +0 -248
  133. data/tools/common/common/test/unittest_table.py +0 -448
  134. data/tools/common/common/test/unittest_taskqueue.py +0 -71
  135. data/tools/common/common/test/unittest_testlib.py +0 -956
  136. data/tools/common/common/test/unittest_textutils.py +0 -247
  137. data/tools/common/common/test/unittest_tree.py +0 -248
  138. data/tools/common/common/test/unittest_umessage.py +0 -55
  139. data/tools/common/common/test/unittest_ureports_html.py +0 -64
  140. data/tools/common/common/test/unittest_ureports_text.py +0 -105
  141. data/tools/common/common/test/unittest_xmlutils.py +0 -75
  142. data/tools/common/common/test/utils.py +0 -87
  143. data/tools/common/common/testlib.py +0 -1927
  144. data/tools/common/common/textutils.py +0 -476
  145. data/tools/common/common/tree.py +0 -372
  146. data/tools/common/common/umessage.py +0 -161
  147. data/tools/common/common/ureports/__init__.py +0 -174
  148. data/tools/common/common/ureports/docbook_writer.py +0 -139
  149. data/tools/common/common/ureports/html_writer.py +0 -131
  150. data/tools/common/common/ureports/nodes.py +0 -201
  151. data/tools/common/common/ureports/text_writer.py +0 -140
  152. data/tools/common/common/vcgutils.py +0 -216
  153. data/tools/common/common/visitor.py +0 -107
  154. data/tools/common/common/xmlrpcutils.py +0 -136
  155. data/tools/common/common/xmlutils.py +0 -61
  156. data/tools/coverage/coverage.py +0 -602
  157. data/tools/epydoc/__init__.py +0 -227
  158. data/tools/epydoc/__init__.pyc +0 -0
  159. data/tools/epydoc/apidoc.py +0 -2203
  160. data/tools/epydoc/apidoc.pyc +0 -0
  161. data/tools/epydoc/checker.py +0 -349
  162. data/tools/epydoc/checker.pyc +0 -0
  163. data/tools/epydoc/cli.py +0 -1470
  164. data/tools/epydoc/cli.pyc +0 -0
  165. data/tools/epydoc/compat.py +0 -250
  166. data/tools/epydoc/compat.pyc +0 -0
  167. data/tools/epydoc/docbuilder.py +0 -1358
  168. data/tools/epydoc/docbuilder.pyc +0 -0
  169. data/tools/epydoc/docintrospecter.py +0 -1056
  170. data/tools/epydoc/docintrospecter.pyc +0 -0
  171. data/tools/epydoc/docparser.py +0 -2113
  172. data/tools/epydoc/docparser.pyc +0 -0
  173. data/tools/epydoc/docstringparser.py +0 -1111
  174. data/tools/epydoc/docstringparser.pyc +0 -0
  175. data/tools/epydoc/docwriter/__init__.py +0 -12
  176. data/tools/epydoc/docwriter/__init__.pyc +0 -0
  177. data/tools/epydoc/docwriter/dotgraph.py +0 -1351
  178. data/tools/epydoc/docwriter/dotgraph.pyc +0 -0
  179. data/tools/epydoc/docwriter/html.py +0 -3491
  180. data/tools/epydoc/docwriter/html.pyc +0 -0
  181. data/tools/epydoc/docwriter/html_colorize.py +0 -909
  182. data/tools/epydoc/docwriter/html_colorize.pyc +0 -0
  183. data/tools/epydoc/docwriter/html_css.py +0 -550
  184. data/tools/epydoc/docwriter/html_css.pyc +0 -0
  185. data/tools/epydoc/docwriter/html_help.py +0 -190
  186. data/tools/epydoc/docwriter/html_help.pyc +0 -0
  187. data/tools/epydoc/docwriter/latex.py +0 -1187
  188. data/tools/epydoc/docwriter/latex.pyc +0 -0
  189. data/tools/epydoc/docwriter/plaintext.py +0 -276
  190. data/tools/epydoc/docwriter/plaintext.pyc +0 -0
  191. data/tools/epydoc/docwriter/xlink.py +0 -505
  192. data/tools/epydoc/docwriter/xlink.pyc +0 -0
  193. data/tools/epydoc/gui.py +0 -1148
  194. data/tools/epydoc/gui.pyc +0 -0
  195. data/tools/epydoc/log.py +0 -204
  196. data/tools/epydoc/log.pyc +0 -0
  197. data/tools/epydoc/markup/__init__.py +0 -623
  198. data/tools/epydoc/markup/__init__.pyc +0 -0
  199. data/tools/epydoc/markup/doctest.py +0 -311
  200. data/tools/epydoc/markup/doctest.pyc +0 -0
  201. data/tools/epydoc/markup/epytext.py +0 -2116
  202. data/tools/epydoc/markup/epytext.pyc +0 -0
  203. data/tools/epydoc/markup/javadoc.py +0 -250
  204. data/tools/epydoc/markup/javadoc.pyc +0 -0
  205. data/tools/epydoc/markup/plaintext.py +0 -78
  206. data/tools/epydoc/markup/plaintext.pyc +0 -0
  207. data/tools/epydoc/markup/pyval_repr.py +0 -532
  208. data/tools/epydoc/markup/pyval_repr.pyc +0 -0
  209. data/tools/epydoc/markup/restructuredtext.py +0 -906
  210. data/tools/epydoc/markup/restructuredtext.pyc +0 -0
  211. data/tools/epydoc/test/__init__.py +0 -97
  212. data/tools/epydoc/test/__init__.pyc +0 -0
  213. data/tools/epydoc/test/util.py +0 -226
  214. data/tools/epydoc/test/util.pyc +0 -0
  215. data/tools/epydoc/util.py +0 -289
  216. data/tools/epydoc/util.pyc +0 -0
  217. data/tools/logilab/logilab/__init__.py +0 -5
  218. data/tools/logilab/logilab/astng/__init__.py +0 -82
  219. data/tools/logilab/logilab/astng/__pkginfo__.py +0 -76
  220. data/tools/logilab/logilab/astng/_exceptions.py +0 -64
  221. data/tools/logilab/logilab/astng/_nodes_ast.py +0 -667
  222. data/tools/logilab/logilab/astng/_nodes_compiler.py +0 -758
  223. data/tools/logilab/logilab/astng/bases.py +0 -608
  224. data/tools/logilab/logilab/astng/builder.py +0 -239
  225. data/tools/logilab/logilab/astng/inference.py +0 -426
  226. data/tools/logilab/logilab/astng/inspector.py +0 -289
  227. data/tools/logilab/logilab/astng/manager.py +0 -421
  228. data/tools/logilab/logilab/astng/mixins.py +0 -165
  229. data/tools/logilab/logilab/astng/node_classes.py +0 -848
  230. data/tools/logilab/logilab/astng/nodes.py +0 -85
  231. data/tools/logilab/logilab/astng/nodes_as_string.py +0 -389
  232. data/tools/logilab/logilab/astng/patchcomptransformer.py +0 -159
  233. data/tools/logilab/logilab/astng/protocols.py +0 -333
  234. data/tools/logilab/logilab/astng/raw_building.py +0 -212
  235. data/tools/logilab/logilab/astng/rebuilder.py +0 -307
  236. data/tools/logilab/logilab/astng/scoped_nodes.py +0 -951
  237. data/tools/logilab/logilab/astng/test/__init__.py +0 -19
  238. data/tools/logilab/logilab/astng/test/data/MyPyPa-0.1.0-py2.5.egg +0 -0
  239. data/tools/logilab/logilab/astng/test/data/MyPyPa-0.1.0-py2.5.zip +0 -0
  240. data/tools/logilab/logilab/astng/test/data/SSL1/Connection1.py +0 -33
  241. data/tools/logilab/logilab/astng/test/data/SSL1/__init__.py +0 -20
  242. data/tools/logilab/logilab/astng/test/data/__init__.py +0 -20
  243. data/tools/logilab/logilab/astng/test/data/all.py +0 -29
  244. data/tools/logilab/logilab/astng/test/data/appl/__init__.py +0 -23
  245. data/tools/logilab/logilab/astng/test/data/appl/myConnection.py +0 -30
  246. data/tools/logilab/logilab/astng/test/data/format.py +0 -34
  247. data/tools/logilab/logilab/astng/test/data/module.py +0 -90
  248. data/tools/logilab/logilab/astng/test/data/module2.py +0 -112
  249. data/tools/logilab/logilab/astng/test/data/noendingnewline.py +0 -57
  250. data/tools/logilab/logilab/astng/test/data/nonregr.py +0 -76
  251. data/tools/logilab/logilab/astng/test/data/notall.py +0 -28
  252. data/tools/logilab/logilab/astng/test/data2/__init__.py +0 -20
  253. data/tools/logilab/logilab/astng/test/data2/clientmodule_test.py +0 -51
  254. data/tools/logilab/logilab/astng/test/data2/suppliermodule_test.py +0 -32
  255. data/tools/logilab/logilab/astng/test/regrtest.py +0 -135
  256. data/tools/logilab/logilab/astng/test/regrtest_data/absimport.py +0 -22
  257. data/tools/logilab/logilab/astng/test/regrtest_data/descriptor_crash.py +0 -31
  258. data/tools/logilab/logilab/astng/test/regrtest_data/import_package_subpackage_module.py +0 -68
  259. data/tools/logilab/logilab/astng/test/regrtest_data/package/__init__.py +0 -24
  260. data/tools/logilab/logilab/astng/test/regrtest_data/package/subpackage/__init__.py +0 -20
  261. data/tools/logilab/logilab/astng/test/regrtest_data/package/subpackage/module.py +0 -20
  262. data/tools/logilab/logilab/astng/test/unittest_builder.py +0 -684
  263. data/tools/logilab/logilab/astng/test/unittest_inference.py +0 -1112
  264. data/tools/logilab/logilab/astng/test/unittest_inspector.py +0 -105
  265. data/tools/logilab/logilab/astng/test/unittest_lookup.py +0 -302
  266. data/tools/logilab/logilab/astng/test/unittest_manager.py +0 -98
  267. data/tools/logilab/logilab/astng/test/unittest_nodes.py +0 -302
  268. data/tools/logilab/logilab/astng/test/unittest_scoped_nodes.py +0 -501
  269. data/tools/logilab/logilab/astng/test/unittest_utils.py +0 -104
  270. data/tools/logilab/logilab/astng/utils.py +0 -342
  271. data/tools/logilab/logilab/common/__init__.py +0 -140
  272. data/tools/logilab/logilab/common/__pkginfo__.py +0 -43
  273. data/tools/logilab/logilab/common/adbh.py +0 -35
  274. data/tools/logilab/logilab/common/cache.py +0 -114
  275. data/tools/logilab/logilab/common/changelog.py +0 -234
  276. data/tools/logilab/logilab/common/clcommands.py +0 -181
  277. data/tools/logilab/logilab/common/cli.py +0 -212
  278. data/tools/logilab/logilab/common/compat.py +0 -328
  279. data/tools/logilab/logilab/common/configuration.py +0 -1087
  280. data/tools/logilab/logilab/common/contexts.py +0 -58
  281. data/tools/logilab/logilab/common/corbautils.py +0 -117
  282. data/tools/logilab/logilab/common/daemon.py +0 -171
  283. data/tools/logilab/logilab/common/date.py +0 -279
  284. data/tools/logilab/logilab/common/db.py +0 -49
  285. data/tools/logilab/logilab/common/dbf.py +0 -229
  286. data/tools/logilab/logilab/common/debugger.py +0 -208
  287. data/tools/logilab/logilab/common/decorators.py +0 -190
  288. data/tools/logilab/logilab/common/deprecation.py +0 -118
  289. data/tools/logilab/logilab/common/fileutils.py +0 -409
  290. data/tools/logilab/logilab/common/graph.py +0 -259
  291. data/tools/logilab/logilab/common/html.py +0 -142
  292. data/tools/logilab/logilab/common/interface.py +0 -76
  293. data/tools/logilab/logilab/common/logging_ext.py +0 -166
  294. data/tools/logilab/logilab/common/modutils.py +0 -670
  295. data/tools/logilab/logilab/common/optik_ext.py +0 -383
  296. data/tools/logilab/logilab/common/optparser.py +0 -92
  297. data/tools/logilab/logilab/common/pdf_ext.py +0 -111
  298. data/tools/logilab/logilab/common/proc.py +0 -276
  299. data/tools/logilab/logilab/common/pyro_ext.py +0 -146
  300. data/tools/logilab/logilab/common/pytest.py +0 -754
  301. data/tools/logilab/logilab/common/shellutils.py +0 -383
  302. data/tools/logilab/logilab/common/sphinx_ext.py +0 -87
  303. data/tools/logilab/logilab/common/sphinxutils.py +0 -122
  304. data/tools/logilab/logilab/common/sqlgen.py +0 -31
  305. data/tools/logilab/logilab/common/table.py +0 -930
  306. data/tools/logilab/logilab/common/tasksqueue.py +0 -97
  307. data/tools/logilab/logilab/common/test/__init__.py +0 -1
  308. data/tools/logilab/logilab/common/test/data/ChangeLog +0 -184
  309. data/tools/logilab/logilab/common/test/data/MyPyPa-0.1.0-py2.5.egg +0 -0
  310. data/tools/logilab/logilab/common/test/data/__init__.py +0 -1
  311. data/tools/logilab/logilab/common/test/data/content_differ_dir/NOTHING +0 -0
  312. data/tools/logilab/logilab/common/test/data/content_differ_dir/README +0 -1
  313. data/tools/logilab/logilab/common/test/data/content_differ_dir/subdir/coin +0 -1
  314. data/tools/logilab/logilab/common/test/data/content_differ_dir/subdir/toto.txt +0 -53
  315. data/tools/logilab/logilab/common/test/data/file_differ_dir/NOTHING +0 -0
  316. data/tools/logilab/logilab/common/test/data/file_differ_dir/README +0 -1
  317. data/tools/logilab/logilab/common/test/data/file_differ_dir/subdir/toto.txt +0 -53
  318. data/tools/logilab/logilab/common/test/data/file_differ_dir/subdirtwo/Hello +0 -0
  319. data/tools/logilab/logilab/common/test/data/find_test/__init__.py +0 -0
  320. data/tools/logilab/logilab/common/test/data/find_test/foo.txt +0 -0
  321. data/tools/logilab/logilab/common/test/data/find_test/module.py +0 -0
  322. data/tools/logilab/logilab/common/test/data/find_test/module2.py +0 -0
  323. data/tools/logilab/logilab/common/test/data/find_test/newlines.txt +0 -0
  324. data/tools/logilab/logilab/common/test/data/find_test/noendingnewline.py +0 -0
  325. data/tools/logilab/logilab/common/test/data/find_test/nonregr.py +0 -0
  326. data/tools/logilab/logilab/common/test/data/find_test/normal_file.txt +0 -0
  327. data/tools/logilab/logilab/common/test/data/find_test/spam.txt +0 -0
  328. data/tools/logilab/logilab/common/test/data/find_test/sub/doc.txt +0 -0
  329. data/tools/logilab/logilab/common/test/data/find_test/sub/momo.py +0 -0
  330. data/tools/logilab/logilab/common/test/data/find_test/test.ini +0 -0
  331. data/tools/logilab/logilab/common/test/data/find_test/test1.msg +0 -0
  332. data/tools/logilab/logilab/common/test/data/find_test/test2.msg +0 -0
  333. data/tools/logilab/logilab/common/test/data/find_test/write_protected_file.txt +0 -0
  334. data/tools/logilab/logilab/common/test/data/foo.txt +0 -9
  335. data/tools/logilab/logilab/common/test/data/module.py +0 -88
  336. data/tools/logilab/logilab/common/test/data/module2.py +0 -77
  337. data/tools/logilab/logilab/common/test/data/newlines.txt +0 -3
  338. data/tools/logilab/logilab/common/test/data/noendingnewline.py +0 -36
  339. data/tools/logilab/logilab/common/test/data/nonregr.py +0 -14
  340. data/tools/logilab/logilab/common/test/data/normal_file.txt +0 -0
  341. data/tools/logilab/logilab/common/test/data/reference_dir/NOTHING +0 -0
  342. data/tools/logilab/logilab/common/test/data/reference_dir/README +0 -1
  343. data/tools/logilab/logilab/common/test/data/reference_dir/subdir/coin +0 -1
  344. data/tools/logilab/logilab/common/test/data/reference_dir/subdir/toto.txt +0 -53
  345. data/tools/logilab/logilab/common/test/data/same_dir/NOTHING +0 -0
  346. data/tools/logilab/logilab/common/test/data/same_dir/README +0 -1
  347. data/tools/logilab/logilab/common/test/data/same_dir/subdir/coin +0 -1
  348. data/tools/logilab/logilab/common/test/data/same_dir/subdir/toto.txt +0 -53
  349. data/tools/logilab/logilab/common/test/data/spam.txt +0 -9
  350. data/tools/logilab/logilab/common/test/data/sub/doc.txt +0 -1
  351. data/tools/logilab/logilab/common/test/data/sub/momo.py +0 -1
  352. data/tools/logilab/logilab/common/test/data/subdir_differ_dir/NOTHING +0 -0
  353. data/tools/logilab/logilab/common/test/data/subdir_differ_dir/README +0 -1
  354. data/tools/logilab/logilab/common/test/data/subdir_differ_dir/subdir/coin +0 -1
  355. data/tools/logilab/logilab/common/test/data/subdir_differ_dir/subdir/toto.txt +0 -53
  356. data/tools/logilab/logilab/common/test/data/test.ini +0 -20
  357. data/tools/logilab/logilab/common/test/data/test1.msg +0 -30
  358. data/tools/logilab/logilab/common/test/data/test2.msg +0 -42
  359. data/tools/logilab/logilab/common/test/data/write_protected_file.txt +0 -0
  360. data/tools/logilab/logilab/common/test/foomod.py +0 -17
  361. data/tools/logilab/logilab/common/test/unittest_cache.py +0 -129
  362. data/tools/logilab/logilab/common/test/unittest_changelog.py +0 -37
  363. data/tools/logilab/logilab/common/test/unittest_compat.py +0 -239
  364. data/tools/logilab/logilab/common/test/unittest_configuration.py +0 -348
  365. data/tools/logilab/logilab/common/test/unittest_date.py +0 -154
  366. data/tools/logilab/logilab/common/test/unittest_decorators.py +0 -62
  367. data/tools/logilab/logilab/common/test/unittest_deprecation.py +0 -76
  368. data/tools/logilab/logilab/common/test/unittest_fileutils.py +0 -133
  369. data/tools/logilab/logilab/common/test/unittest_graph.py +0 -50
  370. data/tools/logilab/logilab/common/test/unittest_html.py +0 -76
  371. data/tools/logilab/logilab/common/test/unittest_interface.py +0 -87
  372. data/tools/logilab/logilab/common/test/unittest_modutils.py +0 -244
  373. data/tools/logilab/logilab/common/test/unittest_pytest.py +0 -50
  374. data/tools/logilab/logilab/common/test/unittest_shellutils.py +0 -248
  375. data/tools/logilab/logilab/common/test/unittest_table.py +0 -448
  376. data/tools/logilab/logilab/common/test/unittest_taskqueue.py +0 -71
  377. data/tools/logilab/logilab/common/test/unittest_testlib.py +0 -956
  378. data/tools/logilab/logilab/common/test/unittest_textutils.py +0 -247
  379. data/tools/logilab/logilab/common/test/unittest_tree.py +0 -248
  380. data/tools/logilab/logilab/common/test/unittest_umessage.py +0 -55
  381. data/tools/logilab/logilab/common/test/unittest_ureports_html.py +0 -64
  382. data/tools/logilab/logilab/common/test/unittest_ureports_text.py +0 -105
  383. data/tools/logilab/logilab/common/test/unittest_xmlutils.py +0 -75
  384. data/tools/logilab/logilab/common/test/utils.py +0 -87
  385. data/tools/logilab/logilab/common/testlib.py +0 -1927
  386. data/tools/logilab/logilab/common/textutils.py +0 -476
  387. data/tools/logilab/logilab/common/tree.py +0 -372
  388. data/tools/logilab/logilab/common/umessage.py +0 -161
  389. data/tools/logilab/logilab/common/ureports/__init__.py +0 -174
  390. data/tools/logilab/logilab/common/ureports/docbook_writer.py +0 -139
  391. data/tools/logilab/logilab/common/ureports/html_writer.py +0 -131
  392. data/tools/logilab/logilab/common/ureports/nodes.py +0 -201
  393. data/tools/logilab/logilab/common/ureports/text_writer.py +0 -140
  394. data/tools/logilab/logilab/common/vcgutils.py +0 -216
  395. data/tools/logilab/logilab/common/visitor.py +0 -107
  396. data/tools/logilab/logilab/common/xmlrpcutils.py +0 -136
  397. data/tools/logilab/logilab/common/xmlutils.py +0 -61
  398. data/tools/pychecker/COPYRIGHT +0 -31
  399. data/tools/pychecker/ChangeLog +0 -349
  400. data/tools/pychecker/CodeChecks.py +0 -1969
  401. data/tools/pychecker/CodeChecks.pyc +0 -0
  402. data/tools/pychecker/CodeChecks.pyo +0 -0
  403. data/tools/pychecker/Config.py +0 -475
  404. data/tools/pychecker/Config.pyc +0 -0
  405. data/tools/pychecker/Config.pyo +0 -0
  406. data/tools/pychecker/KNOWN_BUGS +0 -100
  407. data/tools/pychecker/MAINTAINERS +0 -81
  408. data/tools/pychecker/NEWS +0 -406
  409. data/tools/pychecker/OP.py +0 -131
  410. data/tools/pychecker/OP.pyc +0 -0
  411. data/tools/pychecker/OP.pyo +0 -0
  412. data/tools/pychecker/OptionTypes.py +0 -117
  413. data/tools/pychecker/OptionTypes.pyc +0 -0
  414. data/tools/pychecker/OptionTypes.pyo +0 -0
  415. data/tools/pychecker/README +0 -152
  416. data/tools/pychecker/Stack.py +0 -115
  417. data/tools/pychecker/Stack.pyc +0 -0
  418. data/tools/pychecker/Stack.pyo +0 -0
  419. data/tools/pychecker/TODO +0 -101
  420. data/tools/pychecker/VERSION +0 -1
  421. data/tools/pychecker/Warning.py +0 -50
  422. data/tools/pychecker/Warning.pyc +0 -0
  423. data/tools/pychecker/Warning.pyo +0 -0
  424. data/tools/pychecker/__init__.py +0 -17
  425. data/tools/pychecker/__init__.pyc +0 -0
  426. data/tools/pychecker/__init__.pyo +0 -0
  427. data/tools/pychecker/checker.py +0 -961
  428. data/tools/pychecker/checker.pyc +0 -0
  429. data/tools/pychecker/checker.pyo +0 -0
  430. data/tools/pychecker/function.py +0 -159
  431. data/tools/pychecker/function.pyc +0 -0
  432. data/tools/pychecker/function.pyo +0 -0
  433. data/tools/pychecker/msgs.py +0 -175
  434. data/tools/pychecker/msgs.pyc +0 -0
  435. data/tools/pychecker/msgs.pyo +0 -0
  436. data/tools/pychecker/options.py +0 -275
  437. data/tools/pychecker/options.pyc +0 -0
  438. data/tools/pychecker/options.pyo +0 -0
  439. data/tools/pychecker/pcmodules.py +0 -19
  440. data/tools/pychecker/pcmodules.pyc +0 -0
  441. data/tools/pychecker/pcmodules.pyo +0 -0
  442. data/tools/pychecker/printer.py +0 -47
  443. data/tools/pychecker/printer.pyc +0 -0
  444. data/tools/pychecker/printer.pyo +0 -0
  445. data/tools/pychecker/python.py +0 -427
  446. data/tools/pychecker/python.pyc +0 -0
  447. data/tools/pychecker/python.pyo +0 -0
  448. data/tools/pychecker/utils.py +0 -102
  449. data/tools/pychecker/utils.pyc +0 -0
  450. data/tools/pychecker/utils.pyo +0 -0
  451. data/tools/pychecker/warn.py +0 -778
  452. data/tools/pychecker/warn.pyc +0 -0
  453. data/tools/pychecker/warn.pyo +0 -0
  454. data/tools/pylint2/pylint/__init__.py +0 -16
  455. data/tools/pylint2/pylint/__pkginfo__.py +0 -67
  456. data/tools/pylint2/pylint/checkers/__init__.py +0 -155
  457. data/tools/pylint2/pylint/checkers/base.py +0 -749
  458. data/tools/pylint2/pylint/checkers/classes.py +0 -527
  459. data/tools/pylint2/pylint/checkers/design_analysis.py +0 -344
  460. data/tools/pylint2/pylint/checkers/exceptions.py +0 -183
  461. data/tools/pylint2/pylint/checkers/format.py +0 -367
  462. data/tools/pylint2/pylint/checkers/imports.py +0 -379
  463. data/tools/pylint2/pylint/checkers/logging.py +0 -98
  464. data/tools/pylint2/pylint/checkers/misc.py +0 -128
  465. data/tools/pylint2/pylint/checkers/newstyle.py +0 -107
  466. data/tools/pylint2/pylint/checkers/raw_metrics.py +0 -125
  467. data/tools/pylint2/pylint/checkers/similar.py +0 -333
  468. data/tools/pylint2/pylint/checkers/string_format.py +0 -239
  469. data/tools/pylint2/pylint/checkers/typecheck.py +0 -364
  470. data/tools/pylint2/pylint/checkers/utils.py +0 -208
  471. data/tools/pylint2/pylint/checkers/variables.py +0 -498
  472. data/tools/pylint2/pylint/config.py +0 -149
  473. data/tools/pylint2/pylint/epylint.py +0 -149
  474. data/tools/pylint2/pylint/gui.py +0 -433
  475. data/tools/pylint2/pylint/interfaces.py +0 -98
  476. data/tools/pylint2/pylint/lint.py +0 -914
  477. data/tools/pylint2/pylint/pyreverse/__init__.py +0 -5
  478. data/tools/pylint2/pylint/pyreverse/diadefslib.py +0 -229
  479. data/tools/pylint2/pylint/pyreverse/diagrams.py +0 -247
  480. data/tools/pylint2/pylint/pyreverse/main.py +0 -123
  481. data/tools/pylint2/pylint/pyreverse/utils.py +0 -131
  482. data/tools/pylint2/pylint/pyreverse/writer.py +0 -196
  483. data/tools/pylint2/pylint/reporters/__init__.py +0 -67
  484. data/tools/pylint2/pylint/reporters/guireporter.py +0 -36
  485. data/tools/pylint2/pylint/reporters/html.py +0 -69
  486. data/tools/pylint2/pylint/reporters/text.py +0 -156
  487. data/tools/pylint2/pylint/utils.py +0 -518
  488. data/tools/pylint2/pylint.py +0 -16
@@ -1,956 +0,0 @@
1
- # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
2
- # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
3
- #
4
- # This file is part of logilab-common.
5
- #
6
- # logilab-common is free software: you can redistribute it and/or modify it under
7
- # the terms of the GNU Lesser General Public License as published by the Free
8
- # Software Foundation, either version 2.1 of the License, or (at your option) any
9
- # later version.
10
- #
11
- # logilab-common is distributed in the hope that it will be useful, but WITHOUT
12
- # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13
- # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14
- # details.
15
- #
16
- # You should have received a copy of the GNU Lesser General Public License along
17
- # with logilab-common. If not, see <http://www.gnu.org/licenses/>.
18
- """unittest module for logilab.comon.testlib"""
19
-
20
- import unittest
21
- import os
22
- import sys
23
- from os.path import join, dirname, isdir, isfile, abspath, exists
24
- from cStringIO import StringIO
25
- import tempfile
26
- import shutil
27
-
28
- from logilab.common.compat import sorted
29
-
30
- try:
31
- __file__
32
- except NameError:
33
- __file__ = sys.argv[0]
34
-
35
-
36
- from unittest import TestSuite
37
-
38
- from logilab.common.testlib import TestCase, SkipAwareTextTestRunner, Tags
39
- from logilab.common.testlib import mock_object, NonStrictTestLoader, create_files
40
- from logilab.common.testlib import capture_stdout, unittest_main, InnerTest
41
- from logilab.common.testlib import with_tempdir, tag
42
- from logilab.common.testlib import require_version, require_module
43
-
44
- class MockTestCase(TestCase):
45
- def __init__(self):
46
- # Do not call unittest.TestCase's __init__
47
- pass
48
-
49
- def fail(self, msg):
50
- raise AssertionError(msg)
51
-
52
- class UtilTC(TestCase):
53
-
54
- def test_mockobject(self):
55
- obj = mock_object(foo='bar', baz='bam')
56
- self.assertEquals(obj.foo, 'bar')
57
- self.assertEquals(obj.baz, 'bam')
58
-
59
-
60
- def test_create_files(self):
61
- chroot = tempfile.mkdtemp()
62
- path_to = lambda path: join(chroot, path)
63
- dircontent = lambda path: sorted(os.listdir(join(chroot, path)))
64
- try:
65
- self.failIf(isdir(path_to('a/')))
66
- create_files(['a/b/foo.py', 'a/b/c/', 'a/b/c/d/e.py'], chroot)
67
- # make sure directories exist
68
- self.failUnless(isdir(path_to('a')))
69
- self.failUnless(isdir(path_to('a/b')))
70
- self.failUnless(isdir(path_to('a/b/c')))
71
- self.failUnless(isdir(path_to('a/b/c/d')))
72
- # make sure files exist
73
- self.failUnless(isfile(path_to('a/b/foo.py')))
74
- self.failUnless(isfile(path_to('a/b/c/d/e.py')))
75
- # make sure only asked files were created
76
- self.assertEquals(dircontent('a'), ['b'])
77
- self.assertEquals(dircontent('a/b'), ['c', 'foo.py'])
78
- self.assertEquals(dircontent('a/b/c'), ['d'])
79
- self.assertEquals(dircontent('a/b/c/d'), ['e.py'])
80
- finally:
81
- shutil.rmtree(chroot)
82
-
83
-
84
- class TestlibTC(TestCase):
85
-
86
- capture = True
87
-
88
- def mkdir(self,path):
89
- if not exists(path):
90
- self._dirs.add(path)
91
- os.mkdir(path)
92
-
93
- def setUp(self):
94
- self.tc = MockTestCase()
95
- self._dirs = set()
96
-
97
- def tearDown(self):
98
- while(self._dirs):
99
- shutil.rmtree(self._dirs.pop(), ignore_errors=True)
100
-
101
- def test_dict_equals(self):
102
- """tests TestCase.assertDictEquals"""
103
- d1 = {'a' : 1, 'b' : 2}
104
- d2 = {'a' : 1, 'b' : 3}
105
- d3 = dict(d1)
106
- self.assertRaises(AssertionError, self.tc.assertDictEquals, d1, d2)
107
- self.tc.assertDictEquals(d1, d3)
108
- self.tc.assertDictEquals(d3, d1)
109
- self.tc.assertDictEquals(d1, d1)
110
-
111
- def test_list_equals(self):
112
- """tests TestCase.assertListEquals"""
113
- l1 = range(10)
114
- l2 = range(5)
115
- l3 = range(10)
116
- self.assertRaises(AssertionError, self.tc.assertListEquals, l1, l2)
117
- self.tc.assertListEquals(l1, l1)
118
- self.tc.assertListEquals(l1, l3)
119
- self.tc.assertListEquals(l3, l1)
120
-
121
- def test_lines_equals(self):
122
- """tests assertLineEquals"""
123
- t1 = """some
124
- text
125
- """
126
- t2 = """some
127
-
128
- text"""
129
- t3 = """some
130
- text"""
131
- self.assertRaises(AssertionError, self.tc.assertLinesEquals, t1, t2)
132
- self.tc.assertLinesEquals(t1, t3)
133
- self.tc.assertLinesEquals(t3, t1)
134
- self.tc.assertLinesEquals(t1, t1)
135
-
136
- def test_xml_valid(self):
137
- """tests xml is valid"""
138
- valid = """<root>
139
- <hello />
140
- <world>Logilab</world>
141
- </root>"""
142
- invalid = """<root><h2> </root>"""
143
- self.tc.assertXMLStringWellFormed(valid)
144
- self.assertRaises(AssertionError, self.tc.assertXMLStringWellFormed, invalid)
145
- invalid = """<root><h2 </h2> </root>"""
146
- self.assertRaises(AssertionError, self.tc.assertXMLStringWellFormed, invalid)
147
-
148
-
149
- def test_unordered_equality_for_lists(self):
150
- l1 = [0, 1, 2]
151
- l2 = [1, 2, 3]
152
- self.assertRaises(AssertionError, self.tc.assertUnorderedIterableEquals, l1, l2)
153
- self.tc.assertUnorderedIterableEquals(l1, l1)
154
- self.tc.assertUnorderedIterableEquals([], [])
155
- l1 = [0, 1, 1]
156
- l2 = [0, 1]
157
- self.assertRaises(AssertionError, self.tc.assertUnorderedIterableEquals, l1, l2)
158
- self.tc.assertUnorderedIterableEquals(l1, l1)
159
-
160
-
161
- def test_unordered_equality_for_dicts(self):
162
- d1 = {'a' : 1, 'b' : 2}
163
- d2 = {'a' : 1}
164
- self.assertRaises(AssertionError, self.tc.assertUnorderedIterableEquals, d1, d2)
165
- self.tc.assertUnorderedIterableEquals(d1, d1)
166
- self.tc.assertUnorderedIterableEquals({}, {})
167
-
168
- def test_unordered_equality_for_iterables(self):
169
- self.assertRaises(AssertionError, self.tc.assertUnorderedIterableEquals, xrange(5), xrange(6))
170
- self.tc.assertUnorderedIterableEquals(xrange(5), range(5))
171
- self.tc.assertUnorderedIterableEquals([], ())
172
-
173
- def test_unordered_equality_for_dicts(self):
174
- s1 = set('ab')
175
- s2 = set('a')
176
- self.assertRaises(AssertionError, self.tc.assertSetEquals, s1, s2)
177
- self.tc.assertSetEquals(s1, s1)
178
- self.tc.assertSetEquals(set(), set())
179
-
180
- def test_file_equality(self):
181
- foo = join(dirname(__file__), 'data', 'foo.txt')
182
- spam = join(dirname(__file__), 'data', 'spam.txt')
183
- self.assertRaises(AssertionError, self.tc.assertFileEqual, foo, spam)
184
- self.tc.assertFileEqual(foo, foo)
185
-
186
- def test_dir_equality(self):
187
- ref = join(dirname(__file__), 'data', 'reference_dir')
188
- same = join(dirname(__file__), 'data', 'same_dir')
189
- subdir_differ = join(dirname(__file__), 'data', 'subdir_differ_dir')
190
- file_differ = join(dirname(__file__), 'data', 'file_differ_dir')
191
- content_differ = join(dirname(__file__), 'data', 'content_differ_dir')
192
- ed1 = join(dirname(__file__), 'data', 'empty_dir_1')
193
- ed2 = join(dirname(__file__), 'data', 'empty_dir_2')
194
-
195
- for path in (ed1, ed2, join(subdir_differ,'unexpected')):
196
- self.mkdir(path)
197
-
198
- self.assertDirEquals(ed1, ed2)
199
- self.assertDirEquals(ref, ref)
200
- self.assertDirEquals( ref, same)
201
- self.assertRaises(AssertionError, self.assertDirEquals, ed1, ref)
202
- self.assertRaises(AssertionError, self.assertDirEquals, ref, ed2)
203
- self.assertRaises(AssertionError, self.assertDirEquals, subdir_differ, ref)
204
- self.assertRaises(AssertionError, self.assertDirEquals, file_differ, ref)
205
- self.assertRaises(AssertionError, self.assertDirEquals, ref, content_differ)
206
-
207
- def test_stream_equality(self):
208
- foo = join(dirname(__file__), 'data', 'foo.txt')
209
- spam = join(dirname(__file__), 'data', 'spam.txt')
210
- stream1 = file(foo)
211
- self.tc.assertStreamEqual(stream1, stream1)
212
- stream1 = file(foo)
213
- stream2 = file(spam)
214
- self.assertRaises(AssertionError, self.tc.assertStreamEqual, stream1, stream2)
215
-
216
- def test_text_equality(self):
217
- self.assertRaises(AssertionError, self.tc.assertTextEqual, "toto", 12)
218
- self.assertRaises(AssertionError, self.tc.assertTextEqual, "toto", None)
219
- self.assertRaises(AssertionError, self.tc.assertTextEqual, 3.12, u"toto")
220
- self.assertRaises(AssertionError, self.tc.assertTextEqual, None, u"toto")
221
- self.tc.assertTextEqual('toto\ntiti', 'toto\ntiti')
222
- self.tc.assertTextEqual('toto\ntiti', 'toto\n titi\n', striplines=True)
223
- self.assertRaises(AssertionError, self.tc.assertTextEqual, 'toto\ntiti', 'toto\n titi\n')
224
- foo = join(dirname(__file__), 'data', 'foo.txt')
225
- spam = join(dirname(__file__), 'data', 'spam.txt')
226
- text1 = file(foo).read()
227
- self.tc.assertTextEqual(text1, text1)
228
- text2 = file(spam).read()
229
- self.assertRaises(AssertionError, self.tc.assertTextEqual, text1, text2)
230
-
231
-
232
- def test_assert_raises(self):
233
- exc = self.tc.assertRaises(KeyError, {}.__getitem__, 'foo')
234
- self.failUnless(isinstance(exc, KeyError))
235
- self.assertEquals(exc.args, ('foo',))
236
-
237
-
238
- def test_default_datadir(self):
239
- expected_datadir = join(dirname(abspath(__file__)), 'data')
240
- self.assertEquals(self.datadir, expected_datadir)
241
- self.assertEquals(self.datapath('foo'), join(expected_datadir, 'foo'))
242
-
243
- def test_multiple_args_datadir(self):
244
- expected_datadir = join(dirname(abspath(__file__)), 'data')
245
- self.assertEquals(self.datadir, expected_datadir)
246
- self.assertEquals(self.datapath('foo', 'bar'), join(expected_datadir, 'foo', 'bar'))
247
-
248
- def test_custom_datadir(self):
249
- class MyTC(TestCase):
250
- datadir = 'foo'
251
- def test_1(self): pass
252
-
253
- # class' custom datadir
254
- tc = MyTC('test_1')
255
- self.assertEquals(tc.datapath('bar'), join('foo', 'bar'))
256
- # instance's custom datadir
257
- self.skip('should this really works?')
258
- tc.datadir = 'spam'
259
- self.assertEquals(tc.datapath('bar'), join('spam', 'bar'))
260
-
261
-
262
- def test_cached_datadir(self):
263
- """test datadir is cached on the class"""
264
- class MyTC(TestCase):
265
- def test_1(self): pass
266
-
267
- expected_datadir = join(dirname(abspath(__file__)), 'data')
268
- tc = MyTC('test_1')
269
- self.assertEquals(tc.datadir, expected_datadir)
270
- # changing module should not change the datadir
271
- MyTC.__module__ = 'os'
272
- self.assertEquals(tc.datadir, expected_datadir)
273
- # even on new instances
274
- tc2 = MyTC('test_1')
275
- self.assertEquals(tc2.datadir, expected_datadir)
276
-
277
- def test_is(self):
278
- obj_1 = []
279
- obj_2 = []
280
- self.assertIs(obj_1,obj_1)
281
- self.assertRaises(AssertionError, self.assertIs, obj_1, obj_2)
282
-
283
- def test_isnot(self):
284
- obj_1 = []
285
- obj_2 = []
286
- self.assertIsNot(obj_1,obj_2)
287
- self.assertRaises(AssertionError, self.assertIsNot, obj_1, obj_1)
288
-
289
- def test_none(self):
290
- self.assertNone(None)
291
- self.assertRaises(AssertionError, self.assertNone, object())
292
-
293
- def test_none(self):
294
- self.assertNotNone(object())
295
- self.assertRaises(AssertionError, self.assertNotNone, None)
296
-
297
- def test_in(self):
298
- self.assertIn("a", "dsqgaqg")
299
- obj, seq = 'a', ('toto', "azf", "coin")
300
- self.assertRaises(AssertionError, self.assertIn, obj, seq)
301
-
302
- def test_not_in(self):
303
- self.assertNotIn('a', ('toto', "azf", "coin"))
304
- self.assertRaises(AssertionError, self.assertNotIn, 'a', "dsqgaqg")
305
-
306
-
307
- class GenerativeTestsTC(TestCase):
308
-
309
- def setUp(self):
310
- output = StringIO()
311
- self.runner = SkipAwareTextTestRunner(stream=output)
312
-
313
- def test_generative_ok(self):
314
- class FooTC(TestCase):
315
- def test_generative(self):
316
- for i in xrange(10):
317
- yield self.assertEquals, i, i
318
- result = self.runner.run(FooTC('test_generative'))
319
- self.assertEquals(result.testsRun, 10)
320
- self.assertEquals(len(result.failures), 0)
321
- self.assertEquals(len(result.errors), 0)
322
-
323
-
324
- def test_generative_half_bad(self):
325
- class FooTC(TestCase):
326
- def test_generative(self):
327
- for i in xrange(10):
328
- yield self.assertEquals, i%2, 0
329
- result = self.runner.run(FooTC('test_generative'))
330
- self.assertEquals(result.testsRun, 10)
331
- self.assertEquals(len(result.failures), 5)
332
- self.assertEquals(len(result.errors), 0)
333
-
334
-
335
- def test_generative_error(self):
336
- class FooTC(TestCase):
337
- def test_generative(self):
338
- for i in xrange(10):
339
- if i == 5:
340
- raise ValueError('STOP !')
341
- yield self.assertEquals, i, i
342
-
343
- result = self.runner.run(FooTC('test_generative'))
344
- self.assertEquals(result.testsRun, 5)
345
- self.assertEquals(len(result.failures), 0)
346
- self.assertEquals(len(result.errors), 1)
347
-
348
- def test_generative_error2(self):
349
- class FooTC(TestCase):
350
- def test_generative(self):
351
- for i in xrange(10):
352
- if i == 5:
353
- yield self.ouch
354
- yield self.assertEquals, i, i
355
- def ouch(self): raise ValueError('stop !')
356
- result = self.runner.run(FooTC('test_generative'))
357
- self.assertEquals(result.testsRun, 6)
358
- self.assertEquals(len(result.failures), 0)
359
- self.assertEquals(len(result.errors), 1)
360
-
361
-
362
- def test_generative_setup(self):
363
- class FooTC(TestCase):
364
- def setUp(self):
365
- raise ValueError('STOP !')
366
- def test_generative(self):
367
- for i in xrange(10):
368
- yield self.assertEquals, i, i
369
-
370
- result = self.runner.run(FooTC('test_generative'))
371
- self.assertEquals(result.testsRun, 1)
372
- self.assertEquals(len(result.failures), 0)
373
- self.assertEquals(len(result.errors), 1)
374
-
375
- def test_generative_inner_skip(self):
376
- class FooTC(TestCase):
377
- def check(self, val):
378
- if val == 5:
379
- self.innerSkip("no 5")
380
- else:
381
- self.assertEquals(val, val)
382
-
383
- def test_generative(self):
384
- for i in xrange(10):
385
- yield InnerTest("check_%s"%i, self.check, i)
386
-
387
- result = self.runner.run(FooTC('test_generative'))
388
- self.assertEquals(result.testsRun, 10)
389
- self.assertEquals(len(result.failures), 0)
390
- self.assertEquals(len(result.errors), 0)
391
- self.assertEquals(len(result.skipped), 1)
392
-
393
- def test_generative_skip(self):
394
- class FooTC(TestCase):
395
- def check(self, val):
396
- if val == 5:
397
- self.skip("no 5")
398
- else:
399
- self.assertEquals(val, val)
400
-
401
- def test_generative(self):
402
- for i in xrange(10):
403
- yield InnerTest("check_%s"%i, self.check, i)
404
-
405
- result = self.runner.run(FooTC('test_generative'))
406
- self.assertEquals(result.testsRun, 6)
407
- self.assertEquals(len(result.failures), 0)
408
- self.assertEquals(len(result.errors), 0)
409
- self.assertEquals(len(result.skipped), 1)
410
-
411
- def test_generative_inner_error(self):
412
- class FooTC(TestCase):
413
- def check(self, val):
414
- if val == 5:
415
- raise ValueError("no 5")
416
- else:
417
- self.assertEquals(val, val)
418
-
419
- def test_generative(self):
420
- for i in xrange(10):
421
- yield InnerTest("check_%s"%i, self.check, i)
422
-
423
- result = self.runner.run(FooTC('test_generative'))
424
- self.assertEquals(result.testsRun, 6)
425
- self.assertEquals(len(result.failures), 0)
426
- self.assertEquals(len(result.errors), 1)
427
- self.assertEquals(len(result.skipped), 0)
428
-
429
- def test_generative_inner_failure(self):
430
- class FooTC(TestCase):
431
- def check(self, val):
432
- if val == 5:
433
- self.assertEquals(val, val+1)
434
- else:
435
- self.assertEquals(val, val)
436
-
437
- def test_generative(self):
438
- for i in xrange(10):
439
- yield InnerTest("check_%s"%i, self.check, i)
440
-
441
- result = self.runner.run(FooTC('test_generative'))
442
- self.assertEquals(result.testsRun, 10)
443
- self.assertEquals(len(result.failures), 1)
444
- self.assertEquals(len(result.errors), 0)
445
- self.assertEquals(len(result.skipped), 0)
446
-
447
-
448
- class ExitFirstTC(TestCase):
449
- def setUp(self):
450
- output = StringIO()
451
- self.runner = SkipAwareTextTestRunner(stream=output, exitfirst=True)
452
-
453
- def test_failure_exit_first(self):
454
- class FooTC(TestCase):
455
- def test_1(self): pass
456
- def test_2(self): assert False
457
- def test_3(self): pass
458
- tests = [FooTC('test_1'), FooTC('test_2')]
459
- result = self.runner.run(TestSuite(tests))
460
- self.assertEquals(result.testsRun, 2)
461
- self.assertEquals(len(result.failures), 1)
462
- self.assertEquals(len(result.errors), 0)
463
-
464
-
465
- def test_error_exit_first(self):
466
- class FooTC(TestCase):
467
- def test_1(self): pass
468
- def test_2(self): raise ValueError()
469
- def test_3(self): pass
470
- tests = [FooTC('test_1'), FooTC('test_2'), FooTC('test_3')]
471
- result = self.runner.run(TestSuite(tests))
472
- self.assertEquals(result.testsRun, 2)
473
- self.assertEquals(len(result.failures), 0)
474
- self.assertEquals(len(result.errors), 1)
475
-
476
- def test_generative_exit_first(self):
477
- class FooTC(TestCase):
478
- def test_generative(self):
479
- for i in xrange(10):
480
- yield self.assert_, False
481
- result = self.runner.run(FooTC('test_generative'))
482
- self.assertEquals(result.testsRun, 1)
483
- self.assertEquals(len(result.failures), 1)
484
- self.assertEquals(len(result.errors), 0)
485
-
486
-
487
- class TestLoaderTC(TestCase):
488
- ## internal classes for test purposes ########
489
- class FooTC(TestCase):
490
- def test_foo1(self): pass
491
- def test_foo2(self): pass
492
- def test_bar1(self): pass
493
-
494
- class BarTC(TestCase):
495
- def test_bar2(self): pass
496
- ##############################################
497
-
498
- def setUp(self):
499
- self.loader = NonStrictTestLoader()
500
- self.module = TestLoaderTC # mock_object(FooTC=TestLoaderTC.FooTC, BarTC=TestLoaderTC.BarTC)
501
- self.output = StringIO()
502
- self.runner = SkipAwareTextTestRunner(stream=self.output)
503
-
504
- def assertRunCount(self, pattern, module, expected_count, skipped=()):
505
- if pattern:
506
- suite = self.loader.loadTestsFromNames([pattern], module)
507
- else:
508
- suite = self.loader.loadTestsFromModule(module)
509
- self.runner.test_pattern = pattern
510
- self.runner.skipped_patterns = skipped
511
- result = self.runner.run(suite)
512
- self.runner.test_pattern = None
513
- self.runner.skipped_patterns = ()
514
- self.assertEquals(result.testsRun, expected_count)
515
-
516
- def test_collect_everything(self):
517
- """make sure we don't change the default behaviour
518
- for loadTestsFromModule() and loadTestsFromTestCase
519
- """
520
- testsuite = self.loader.loadTestsFromModule(self.module)
521
- self.assertEquals(len(testsuite._tests), 2)
522
- suite1, suite2 = testsuite._tests
523
- self.assertEquals(len(suite1._tests) + len(suite2._tests), 4)
524
-
525
- def test_collect_with_classname(self):
526
- self.assertRunCount('FooTC', self.module, 3)
527
- self.assertRunCount('BarTC', self.module, 1)
528
-
529
- def test_collect_with_classname_and_pattern(self):
530
- data = [('FooTC.test_foo1', 1), ('FooTC.test_foo', 2), ('FooTC.test_fo', 2),
531
- ('FooTC.foo1', 1), ('FooTC.foo', 2), ('FooTC.whatever', 0)
532
- ]
533
- for pattern, expected_count in data:
534
- yield self.assertRunCount, pattern, self.module, expected_count
535
-
536
- def test_collect_with_pattern(self):
537
- data = [('test_foo1', 1), ('test_foo', 2), ('test_bar', 2),
538
- ('foo1', 1), ('foo', 2), ('bar', 2), ('ba', 2),
539
- ('test', 4), ('ab', 0),
540
- ]
541
- for pattern, expected_count in data:
542
- yield self.assertRunCount, pattern, self.module, expected_count
543
-
544
- def test_tescase_with_custom_metaclass(self):
545
- class mymetaclass(type): pass
546
- class MyMod:
547
- class MyTestCase(TestCase):
548
- __metaclass__ = mymetaclass
549
- def test_foo1(self): pass
550
- def test_foo2(self): pass
551
- def test_bar(self): pass
552
- data = [('test_foo1', 1), ('test_foo', 2), ('test_bar', 1),
553
- ('foo1', 1), ('foo', 2), ('bar', 1), ('ba', 1),
554
- ('test', 3), ('ab', 0),
555
- ('MyTestCase.test_foo1', 1), ('MyTestCase.test_foo', 2),
556
- ('MyTestCase.test_fo', 2), ('MyTestCase.foo1', 1),
557
- ('MyTestCase.foo', 2), ('MyTestCase.whatever', 0)
558
- ]
559
- for pattern, expected_count in data:
560
- yield self.assertRunCount, pattern, MyMod, expected_count
561
-
562
-
563
- def test_collect_everything_and_skipped_patterns(self):
564
- testdata = [ (['foo1'], 3), (['foo'], 2),
565
- (['foo', 'bar'], 0),
566
- ]
567
- for skipped, expected_count in testdata:
568
- yield self.assertRunCount, None, self.module, expected_count, skipped
569
-
570
-
571
- def test_collect_specific_pattern_and_skip_some(self):
572
- testdata = [ ('bar', ['foo1'], 2), ('bar', [], 2),
573
- ('bar', ['bar'], 0), ]
574
-
575
- for runpattern, skipped, expected_count in testdata:
576
- yield self.assertRunCount, runpattern, self.module, expected_count, skipped
577
-
578
- def test_skip_classname(self):
579
- testdata = [ (['BarTC'], 3), (['FooTC'], 1), ]
580
- for skipped, expected_count in testdata:
581
- yield self.assertRunCount, None, self.module, expected_count, skipped
582
-
583
- def test_skip_classname_and_specific_collect(self):
584
- testdata = [ ('bar', ['BarTC'], 1), ('foo', ['FooTC'], 0), ]
585
- for runpattern, skipped, expected_count in testdata:
586
- yield self.assertRunCount, runpattern, self.module, expected_count, skipped
587
-
588
-
589
- def test_nonregr_dotted_path(self):
590
- self.assertRunCount('FooTC.test_foo', self.module, 2)
591
-
592
-
593
- def test_inner_tests_selection(self):
594
- class MyMod:
595
- class MyTestCase(TestCase):
596
- def test_foo(self): pass
597
- def test_foobar(self):
598
- for i in xrange(5):
599
- if i%2 == 0:
600
- yield InnerTest('even', lambda: None)
601
- else:
602
- yield InnerTest('odd', lambda: None)
603
- yield lambda: None
604
-
605
- data = [('foo', 7), ('test_foobar', 6), ('even', 3), ('odd', 2),
606
- ]
607
- for pattern, expected_count in data:
608
- yield self.assertRunCount, pattern, MyMod, expected_count
609
-
610
- def test_nonregr_class_skipped_option(self):
611
- class MyMod:
612
- class MyTestCase(TestCase):
613
- def test_foo(self): pass
614
- def test_bar(self): pass
615
- class FooTC(TestCase):
616
- def test_foo(self): pass
617
- self.assertRunCount('foo', MyMod, 2)
618
- self.assertRunCount(None, MyMod, 3)
619
- self.loader.skipped_patterns = self.runner.skipped_patterns = ['FooTC']
620
- self.assertRunCount('foo', MyMod, 1)
621
- self.assertRunCount(None, MyMod, 2)
622
-
623
- def test__classes_are_ignored(self):
624
- class MyMod:
625
- class _Base(TestCase):
626
- def test_1(self): pass
627
- class MyTestCase(_Base):
628
- def test_2(self): pass
629
- self.assertRunCount(None, MyMod, 2)
630
-
631
-
632
- def bootstrap_print(msg, output=sys.stdout):
633
- """sys.stdout will be evaluated at function parsing time"""
634
- # print msg
635
- output.write(msg)
636
-
637
- class OutErrCaptureTC(TestCase):
638
-
639
- def setUp(self):
640
- sys.stdout = sys.stderr = StringIO()
641
- self.runner = SkipAwareTextTestRunner(stream=StringIO(), exitfirst=True, capture=True)
642
-
643
- def tearDown(self):
644
- sys.stdout = sys.__stdout__
645
- sys.stderr = sys.__stderr__
646
-
647
- def test_stdout_capture(self):
648
- class FooTC(TestCase):
649
- def test_stdout(self):
650
- print "foo"
651
- self.assert_(False)
652
- test = FooTC('test_stdout')
653
- result = self.runner.run(test)
654
- captured_out, captured_err = test.captured_output()
655
- self.assertEqual(captured_out.strip(), "foo")
656
- self.assertEqual(captured_err.strip(), "")
657
-
658
- def test_stderr_capture(self):
659
- class FooTC(TestCase):
660
- def test_stderr(self):
661
- print >> sys.stderr, "foo"
662
- self.assert_(False)
663
- test = FooTC('test_stderr')
664
- result = self.runner.run(test)
665
- captured_out, captured_err = test.captured_output()
666
- self.assertEqual(captured_out.strip(), "")
667
- self.assertEqual(captured_err.strip(), "foo")
668
-
669
-
670
- def test_both_capture(self):
671
- class FooTC(TestCase):
672
- def test_stderr(self):
673
- print >> sys.stderr, "foo"
674
- print "bar"
675
- self.assert_(False)
676
- test = FooTC('test_stderr')
677
- result = self.runner.run(test)
678
- captured_out, captured_err = test.captured_output()
679
- self.assertEqual(captured_out.strip(), "bar")
680
- self.assertEqual(captured_err.strip(), "foo")
681
-
682
- def test_no_capture(self):
683
- class FooTC(TestCase):
684
- def test_stderr(self):
685
- print >> sys.stderr, "foo"
686
- print "bar"
687
- self.assert_(False)
688
- test = FooTC('test_stderr')
689
- # this runner should not capture stdout / stderr
690
- runner = SkipAwareTextTestRunner(stream=StringIO(), exitfirst=True)
691
- result = runner.run(test)
692
- captured_out, captured_err = test.captured_output()
693
- self.assertEqual(captured_out.strip(), "")
694
- self.assertEqual(captured_err.strip(), "")
695
-
696
-
697
- def test_capture_core(self):
698
- # output = capture_stdout()
699
- # bootstrap_print("hello", output=sys.stdout)
700
- # self.assertEquals(output.restore(), "hello")
701
- output = capture_stdout()
702
- bootstrap_print("hello")
703
- self.assertEquals(output.restore(), "hello")
704
-
705
- def test_unicode_non_ascii_messages(self):
706
- class FooTC(TestCase):
707
- def test_xxx(self):
708
- raise Exception(u'\xe9')
709
- test = FooTC('test_xxx')
710
- # run the test and make sure testlib doesn't raise an exception
711
- result = self.runner.run(test)
712
-
713
- def test_encoded_non_ascii_messages(self):
714
- class FooTC(TestCase):
715
- def test_xxx(self):
716
- raise Exception('\xe9')
717
- test = FooTC('test_xxx')
718
- # run the test and make sure testlib doesn't raise an exception
719
- result = self.runner.run(test)
720
-
721
-
722
- class DecoratorTC(TestCase):
723
-
724
- @with_tempdir
725
- def test_tmp_dir_normal(self):
726
-
727
-
728
- tempdir = tempfile.gettempdir()
729
- # assert temp directory is empty
730
- self.assertListEquals(list(os.walk(tempdir)),
731
- [(tempdir,[],[])])
732
-
733
- witness = []
734
-
735
- @with_tempdir
736
- def createfile(list):
737
- fd1, fn1 = tempfile.mkstemp()
738
- fd2, fn2 = tempfile.mkstemp()
739
- dir = tempfile.mkdtemp()
740
- fd3, fn3 = tempfile.mkstemp(dir=dir)
741
- tempfile.mkdtemp()
742
- list.append(True)
743
- for fd in (fd1, fd2, fd3):
744
- os.close(fd)
745
-
746
- self.assertFalse(witness)
747
- createfile(witness)
748
- self.assertTrue(witness)
749
-
750
- self.assertEquals(tempfile.gettempdir(), tempdir)
751
-
752
- # assert temp directory is empty
753
- self.assertListEquals(list(os.walk(tempdir)),
754
- [(tempdir,[],[])])
755
-
756
- @with_tempdir
757
- def test_tmp_dir_normal(self):
758
-
759
- tempdir = tempfile.gettempdir()
760
- # assert temp directory is empty
761
- self.assertListEquals(list(os.walk(tempfile.tempdir)),
762
- [(tempfile.tempdir,[],[])])
763
-
764
-
765
- class WitnessException(Exception):
766
- pass
767
-
768
- @with_tempdir
769
- def createfile():
770
- fd1, fn1 = tempfile.mkstemp()
771
- fd2, fn2 = tempfile.mkstemp()
772
- dir = tempfile.mkdtemp()
773
- fd3, fn3 = tempfile.mkstemp(dir=dir)
774
- tempfile.mkdtemp()
775
- for fd in (fd1, fd2, fd3):
776
- os.close(fd)
777
- raise WitnessException()
778
-
779
- self.assertRaises(WitnessException, createfile)
780
-
781
-
782
- # assert tempdir didn't change
783
- self.assertEquals(tempfile.gettempdir(), tempdir)
784
-
785
- # assert temp directory is empty
786
- self.assertListEquals(list(os.walk(tempdir)),
787
- [(tempdir,[],[])])
788
-
789
-
790
- def setUp(self):
791
- self.pyversion = sys.version_info
792
-
793
- def tearDown(self):
794
- sys.version_info = self.pyversion
795
-
796
- def test_require_version_good(self):
797
- """ should return the same function
798
- """
799
- def func() :
800
- pass
801
- sys.version_info = (2, 5, 5, 'final', 4)
802
- current = sys.version_info[:3]
803
- compare = ('2.4', '2.5', '2.5.4', '2.5.5')
804
- for version in compare:
805
- decorator = require_version(version)
806
- self.assertEquals(func, decorator(func), '%s =< %s : function \
807
- return by the decorator should be the same.' % (version,
808
- '.'.join([str(element) for element in current])))
809
-
810
- def test_require_version_bad(self):
811
- """ should return a different function : skipping test
812
- """
813
- def func() :
814
- pass
815
- sys.version_info = (2, 5, 5, 'final', 4)
816
- current = sys.version_info[:3]
817
- compare = ('2.5.6', '2.6', '2.6.5')
818
- for version in compare:
819
- decorator = require_version(version)
820
- self.assertNotEquals(func, decorator(func), '%s >= %s : function \
821
- return by the decorator should NOT be the same.'
822
- % ('.'.join([str(element) for element in current]), version))
823
-
824
- def test_require_version_exception(self):
825
- """ should throw a ValueError exception
826
- """
827
- def func() :
828
- pass
829
- compare = ('2.5.a', '2.a', 'azerty')
830
- for version in compare:
831
- decorator = require_version(version)
832
- self.assertRaises(ValueError, decorator, func)
833
-
834
- def test_require_module_good(self):
835
- """ should return the same function
836
- """
837
- def func() :
838
- pass
839
- module = 'sys'
840
- decorator = require_module(module)
841
- self.assertEquals(func, decorator(func), 'module %s exists : function \
842
- return by the decorator should be the same.' % module)
843
-
844
- def test_require_module_bad(self):
845
- """ should return a different function : skipping test
846
- """
847
- def func() :
848
- pass
849
- modules = ('bla', 'blo', 'bli')
850
- for module in modules:
851
- try:
852
- __import__(module)
853
- pass
854
- except ImportError:
855
- decorator = require_module(module)
856
- self.assertNotEquals(func, decorator(func), 'module %s does \
857
- not exist : function return by the decorator should \
858
- NOT be the same.' % module)
859
- return
860
- print 'all modules in %s exist. Could not test %s' % (', '.join(modules),
861
- sys._getframe().f_code.co_name)
862
-
863
- class TagTC(TestCase):
864
-
865
- def setUp(self):
866
- @tag('testing', 'bob')
867
- def bob(a, b, c):
868
- return (a + b) * c
869
-
870
- self.func = bob
871
-
872
- class TagTestTC(TestCase):
873
- tags = Tags(('one', 'two'))
874
-
875
- def test_one(self):
876
- self.assertTrue(True)
877
-
878
- @tag('two', 'three')
879
- def test_two(self):
880
- self.assertTrue(True)
881
-
882
- @tag('three')
883
- def test_three(self):
884
- self.assertTrue(True)
885
- self.cls = TagTestTC
886
-
887
- def test_tag_decorator(self):
888
- bob = self.func
889
-
890
- self.assertEquals(bob(2, 3, 7), 35)
891
- self.assertTrue(hasattr(bob, 'tags'))
892
- self.assertSetEquals(bob.tags, set(['testing','bob']))
893
-
894
-
895
- def test_tags_class(self):
896
- tags = self.func.tags
897
-
898
- self.assertTrue(tags['testing'])
899
- self.assertFalse(tags['Not inside'])
900
-
901
- def test_tags_match(self):
902
- tags = self.func.tags
903
-
904
- self.assertTrue(tags.match('testing'))
905
- self.assertFalse(tags.match('other'))
906
-
907
- self.assertFalse(tags.match('testing and coin'))
908
- self.assertTrue(tags.match('testing or other'))
909
-
910
- self.assertTrue(tags.match('not other'))
911
-
912
- self.assertTrue(tags.match('not other or (testing and bibi)'))
913
- self.assertTrue(tags.match('other or (testing and bob)'))
914
-
915
- def test_tagged_class(self):
916
- def options(tags):
917
- class Options(object):
918
- tags_pattern = tags
919
- return Options()
920
-
921
- cls = self.cls
922
-
923
- runner = SkipAwareTextTestRunner()
924
- self.assertTrue(runner.does_match_tags(cls.test_one))
925
- self.assertTrue(runner.does_match_tags(cls.test_two))
926
- self.assertTrue(runner.does_match_tags(cls.test_three))
927
-
928
- runner = SkipAwareTextTestRunner(options=options('one'))
929
- self.assertTrue(runner.does_match_tags(cls.test_one))
930
- self.assertFalse(runner.does_match_tags(cls.test_two))
931
- self.assertFalse(runner.does_match_tags(cls.test_three))
932
-
933
- runner = SkipAwareTextTestRunner(options=options('two'))
934
- self.assertTrue(runner.does_match_tags(cls.test_one))
935
- self.assertTrue(runner.does_match_tags(cls.test_two))
936
- self.assertFalse(runner.does_match_tags(cls.test_three))
937
-
938
- runner = SkipAwareTextTestRunner(options=options('three'))
939
- self.assertFalse(runner.does_match_tags(cls.test_one))
940
- self.assertTrue(runner.does_match_tags(cls.test_two))
941
- self.assertTrue(runner.does_match_tags(cls.test_three))
942
-
943
- runner = SkipAwareTextTestRunner(options=options('two or three'))
944
- self.assertTrue(runner.does_match_tags(cls.test_one))
945
- self.assertTrue(runner.does_match_tags(cls.test_two))
946
- self.assertTrue(runner.does_match_tags(cls.test_three))
947
-
948
- runner = SkipAwareTextTestRunner(options=options('two and three'))
949
- self.assertFalse(runner.does_match_tags(cls.test_one))
950
- self.assertTrue(runner.does_match_tags(cls.test_two))
951
- self.assertFalse(runner.does_match_tags(cls.test_three))
952
-
953
-
954
-
955
- if __name__ == '__main__':
956
- unittest_main()