Skip to content

Commit

Permalink
Test: restructure (#8)
Browse files Browse the repository at this point in the history
* Change: move test.py into test

* Add: python executable variable

* Fix: cute travis -> cute test

* Fix: install first
  • Loading branch information
eight04 committed May 12, 2018
1 parent ef0ae2e commit 17fcbed
Show file tree
Hide file tree
Showing 132 changed files with 18 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ before_install:
- sudo apt-get -qq update
- sudo apt-get install -y pngcheck
script:
- python cute.py travis
- pip install -e .
- python cute.py test
22 changes: 12 additions & 10 deletions cute.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! python3

import sys
from xcute import cute, Skip
from xcute import cute, Skip, conf

def readme():
"""Live reload readme"""
Expand All @@ -11,22 +11,25 @@ def readme():
server.serve(open_url_delay=1, root="build/readme")

IS_LATEST = sys.version_info[:2] == (3, 6)

conf.update({
"python": "{!r}".format(sys.executable)
})

cute(
pkg_name = "apng",
lint = "pylint cute.py test.py apng",
lint = Skip("pylint cute.py test/test.py apng", sys.version_info < (3, )),
test = [
"lint",
'{py:2} test.py',
'{py:3} test.py',
'readme_build'
"{python} test/test.py",
"readme_build"
],
bump_pre = 'test',
bump_post = ['dist', 'release', 'publish', 'install'],
clean = "x-clean build dist",
dist = [
"clean",
"python setup.py sdist bdist_wheel"
"{python} setup.py sdist bdist_wheel"
],
release = [
'git add .',
Expand All @@ -37,14 +40,13 @@ def readme():
'twine upload dist/*',
'git push --follow-tags'
],
install = 'pip install -e .',
install = '{python} -m pip install -e .',
readme_build = [
'python setup.py --long-description | x-pipe build/readme/index.rst',
'{python} setup.py --long-description | x-pipe build/readme/index.rst',
'rst2html5.py --no-raw --exit-status=1 --verbose '
'build/readme/index.rst build/readme/index.html'
],
readme_pre = "readme_build",
readme = readme,
doc = 'sphinx-autobuild -B -z {pkg_name} docs docs/build',
travis = [Skip("lint", not IS_LATEST), "python test.py", "readme_build"]
doc = 'sphinx-autobuild -B -z {pkg_name} docs docs/build'
)
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
8 changes: 4 additions & 4 deletions test.py → test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
from apng import APNG

try:
import pathlib
except ImportError:
import pathlib2 as pathlib
except ImportError:
import pathlib

try:
import unittest2 as unittest
Expand Down Expand Up @@ -37,7 +37,7 @@ def iter_frames(dir_):
yield frame[".png"], ctrl


for dir_ in pathlib.Path("test").iterdir():
for dir_ in pathlib.Path("test/fixtures").iterdir():
with self.subTest("dir: {}".format(dir_.name)):
try:
options = json.loads(dir_.joinpath("property.json").read_text())
Expand All @@ -54,7 +54,7 @@ def iter_frames(dir_):
)

def test_disassemble(self):
for dir_ in pathlib.Path("test").iterdir():
for dir_ in pathlib.Path("test/fixtures").iterdir():
with self.subTest(dir_.stem):
im = APNG.open(dir_.joinpath("animated.png"))
options_file = dir_.joinpath("property.json")
Expand Down

0 comments on commit 17fcbed

Please sign in to comment.