choba-1.0.2
توضیحات
Python unittest simplified.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | POSIX |
| نام فایل | choba-1.0.2 |
| نام | choba |
| نسخه کتابخانه | 1.0.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Rendra Suroso |
| ایمیل نویسنده | rs@cogsci.bandungfe.net |
| آدرس صفحه اصلی | http://bfi.io |
| آدرس اینترنتی | https://pypi.org/project/choba/ |
| مجوز | MIT |
choba
=====
Wrapper to simplify calls to python `unittest`,
[`coverage`](https://pypi.org/project/coverage/) and
[`webtest`](https://pypi.org/project/WebTest/).
## Installation
```sh
$ pip install choba
$ choba -h
Usage: choba [-hl] [-s <submodule>] [-f <filter>] <dir>
```
## Usage
```sh
$ export PYTHONPATH=`pwd`/src
$ choba <your_test_directory>
```
The call will internally process `./.coveragerc`. HTML and
Cobertura-compatible XML code coverage report are automatically
generated.
##### sample configuration `.coveragerc`:
```txt
[run]
source = src
omit =
src/myproject/__init__.py
src/myproject/daemon.py
*/__main__.py
[html]
directory = docs/coverage
[xml]
output = docs/coverage/coverage.xml
[report]
exclude_lines = if __name__ ==
```
In choba, [branch coverage](https://coverage.readthedocs.io/en/coverage-5.0.3/branch.html)
is always true regardless what you put in the configuration file.
##### sample module:
```python
# ./src/myproject/common/utils.py
import re
def flatten(text):
"""
Remove line breaks and trim.
"""
text = re.sub(r'[\r\n\t]+', ' ', text)
text = re.sub(r' +', ' ', text)
return text.strip()
```
##### sample test:
```python
# ./tests/common/utils.py
import unittest
# test against ./src/myproject/common/utils.py
from myproject import utils
class TestCommon(unittest.TestCase):
def test_myfunc(self):
text = "\raaa\nbbb\t\r\n"
self.assertEquals("aaa bbb", utils.flatten(text))
```
نیازمندی
| مقدار | نام |
|---|---|
| - | webtest |
| - | coverage |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4 | Python |
نحوه نصب
نصب پکیج whl choba-1.0.2:
pip install choba-1.0.2.whl
نصب پکیج tar.gz choba-1.0.2:
pip install choba-1.0.2.tar.gz