Skip to content

Commit 621c16b

Browse files
authored
improving unit test for core modules (#9)
FEATURE: - Add testing framework supported `scenario` and `step`, inspire by *ThoughtWorks, Guage* (#9) ENHANCEMENT: - Add unit testing cases to improving line coverage at core modules. (#9) - Improved CI workflow. (#9) BUGFIX: - Fix JSON decoding error for py3.5. (#9)
1 parent 214e08e commit 621c16b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1388
-519
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,6 @@ venv.bak/
107107
.idea/
108108
.vscode/
109109
~*
110+
111+
# Debug
112+
*.stackdump

.travis.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ dist: xenial
99
sudo: true
1010

1111
# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
12-
install: pip install -U tox-travis
12+
install: pip install -e .[ci]
1313

1414
# command to run tests, e.g. python setup.py test
15-
script: tox
15+
script:
16+
- make lint
17+
- make test-cov
18+
19+
after_success:
20+
- bash <(curl -s https://codecov.io/bash)
1621

1722
before_deploy:
18-
- pip install -e .[doc]
1923
- make docs
2024
- touch docs/build/html/.nojekyll
2125

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ test: clean
3535
pytest
3636

3737
test-cov: clean
38-
pytest --cov=ucloud
38+
pytest --cov=ucloud/core tests/test_core
3939

4040
test-acc: clean
4141
USDKACC=1 pytest --cov=ucloud
@@ -44,10 +44,10 @@ test-all: clean
4444
tox
4545

4646
lint:
47-
black --check ucloud/
47+
@flake8 --exclude=ucloud/services ucloud --ignore=E501,F401
4848

4949
fmt:
50-
@black ./ucloud
50+
@black -l 80 ucloud tests
5151

5252
dev:
5353
@pip install -e .[dev]

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<p align="center">
2+
<img src="https://ucloud-sdk.dl.ufileos.com/logos%2Flogo-mini.png" />
3+
</p>
4+
5+
<h1 align="center">UCloud Go Python3</h1>
6+
7+
<p align="center">
8+
<a href="https://pypi.python.org/pypi/ucloud-sdk-python3/"><img src="https://img.shields.io/pypi/v/ucloud-sdk-python3.svg" alt="Latest Stable Version"></a>
9+
<a href="https://travis-ci.org/ucloud/ucloud-sdk-python3"><img src="https://travis-ci.org/ucloud/ucloud-sdk-python3.svg?branch=master" alt="Travis CI Status"></a>
10+
<a href="https://codecov.io/github/ucloud/ucloud-sdk-python3?branch=master"><img src="https://codecov.io/github/ucloud/ucloud-sdk-python3/coverage.svg?branch=master" alt="Codecov Status"></a>
11+
<a href="https://ucloud.github.io/ucloud-sdk-python3/"><img src="https://img.shields.io/badge/docs-passing-brightgreen.svg" alt="Doc Status"></a>
12+
</p>
13+
14+
UCloud SDK is a Python client library for accessing the UCloud API.
15+
16+
This client can run on Linux, macOS and Windows. It requires Python 3.5 and above.
17+
18+
- Website: https://www.ucloud.cn/
19+
- Free software: Apache 2.0 license
20+
- `Documentation <https://ucloud.github.io/ucloud-sdk-python3/>`_

README.rst

Lines changed: 0 additions & 23 deletions
This file was deleted.

pytest.ini

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
[pytest]
2-
log_cli = 1
3-
log_cli_level = INFO
4-
log_cli_format = %(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s %(name)s)
5-
log_cli_date_format=%Y-%m-%d %H:%M:%S
62
testpaths = ucloud tests
7-
addopts = -s -v --doctest-modules
3+
addopts = --doctest-modules

scripts/gen-services.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
""" Code is generated by ucloud-model, DO NOT EDIT IT. """
3+
# Code is generated by ucloud-model, DO NOT EDIT IT.
44

55
ucloud-model sdk apis --lang python3 --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/clients.tpl --output ./ucloud/client.py
66
ucloud-model sdk apis --lang python3 --type public --template ../ucloud-api-model-v2/apisdk/lang/python/templates/docs.tpl --output ./docs/services.rst

0 commit comments

Comments
 (0)