test: add basic test code and attribute create api test case

This commit is contained in:
penzai
2020-01-17 15:08:46 +08:00
parent 17392be138
commit 105327bb0c
5 changed files with 160 additions and 1 deletions

16
cmdb-api/Makefile Normal file
View File

@@ -0,0 +1,16 @@
default: help
test: ## test in local environment
pytest -s --html=test-output/test/index.html --cov-report html:test-output/coverage --cov=api tests
clean_test: ## clean test output
rm -f .coverage
rm -rf .pytest_cache
rm -rf test-output
docker_test: ## test all case in docker container
@echo "TODO"
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' ./Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'