Skip to content

Commit

Permalink
[SUPPORT] travis-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
高俊奇 committed May 26, 2017
1 parent 8b4062c commit 5fc4328
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: python
python:
- "2.7"
install:
- pip install -r requirements.txt
script: pytest
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==3.1.0
21 changes: 21 additions & 0 deletions test_poetry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#! -*- coding: utf-8 -*-
"""
测试古诗JSON文件是否有效
"""

import os, json

def check_json(json):
filepath = os.path.join('./json', json)
with open(filepath) as file:
try:
_ = json.loads(file.read())
return True
except:
assert False, "校验(%s)失败" % json


def test_json():
map(check_json, os.listdir('./json'))

0 comments on commit 5fc4328

Please sign in to comment.