Добавление тестов и переход на 0.3
parent
50f5a2210e
commit
047c200d7d
|
@ -39,6 +39,7 @@ pip-log.txt
|
||||||
.coverage
|
.coverage
|
||||||
.tox
|
.tox
|
||||||
nosetests.xml
|
nosetests.xml
|
||||||
|
.pytest_cache
|
||||||
|
|
||||||
# Translations
|
# Translations
|
||||||
*.mo
|
*.mo
|
||||||
|
|
5
Makefile
5
Makefile
|
@ -1,4 +1,7 @@
|
||||||
all: bdist
|
all: test bdist
|
||||||
|
|
||||||
bdist:
|
bdist:
|
||||||
python3 setup.py sdist bdist_wheel
|
python3 setup.py sdist bdist_wheel
|
||||||
|
|
||||||
|
test:
|
||||||
|
pytest -q
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
[pytest]
|
||||||
|
testpaths = tests
|
||||||
|
python_files = test*.py
|
2
setup.py
2
setup.py
|
@ -33,7 +33,7 @@ tests_require = [
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='flatfilecms',
|
name='flatfilecms',
|
||||||
version='0.2',
|
version='0.3',
|
||||||
description='flat-file CMS suitable for static site',
|
description='flat-file CMS suitable for static site',
|
||||||
long_description=README + '\n\n' + CHANGES,
|
long_description=README + '\n\n' + CHANGES,
|
||||||
classifiers=[
|
classifiers=[
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
title: Заглушка для тестов БД
|
||||||
|
description: Тестовая страница
|
||||||
|
template: onepage
|
||||||
|
---
|
||||||
|
|
||||||
|
Hello World!
|
|
@ -0,0 +1,16 @@
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def pages():
|
||||||
|
from flatfilecms.resources import Root
|
||||||
|
return Root('../tests/pages')
|
||||||
|
|
||||||
|
|
||||||
|
def test_loading(pages):
|
||||||
|
assert 'index' in pages
|
||||||
|
|
||||||
|
|
||||||
|
def test_db_contains_pages(pages):
|
||||||
|
assert pages['index'].title == 'Заглушка для тестов БД'
|
||||||
|
pass
|
Reference in New Issue