Added basic testing harness for travis · dstufft/httpswatch@168c1cd · GitHub
Skip to content

Commit 168c1cd

Browse files
committed
Added basic testing harness for travis
1 parent c6c154d commit 168c1cd

5 files changed

Lines changed: 38 additions & 0 deletions

File tree

‎.gitignore‎

Lines changed: 2 additions & 0 deletions

‎.travis.yml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
language: python
2+
python: 2.7
3+
env:
4+
- TOXENV=py34
5+
- TOXENV=pep8
6+
7+
install:
8+
- pip install tox
9+
10+
script:
11+
- tox

‎check_https.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def fail(self, desc):
3434
self.icon = "bad"
3535
self.description = desc
3636

37+
3738
def check_one_site(site):
3839
domain = site["domain"]
3940
log.info("Checking {}".format(domain))
@@ -148,6 +149,7 @@ def check_one_site(site):
148149

149150
site["status"] = "mediocre" if mediocre else "good"
150151

152+
151153
def worker(q):
152154
while True:
153155
try:
@@ -159,6 +161,7 @@ def worker(q):
159161
except Exception:
160162
log.exception("{} failed!".format(site["domain"]))
161163

164+
162165
def check_sites():
163166
# Read list of sites.
164167
with open("sites.json", encoding="utf-8") as fp:
@@ -192,11 +195,13 @@ def check_sites():
192195

193196
return data
194197

198+
195199
def encode_check(o):
196200
if not isinstance(o, Check):
197201
raise TypeError
198202
return o.__dict__
199203

204+
200205
def main():
201206
if "--cached" in sys.argv:
202207
with open("cache.json", "r", encoding="utf-8") as fp:

‎setup.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from setuptools import setup
2+
3+
setup()

‎tox.ini‎

Lines changed: 17 additions & 0 deletions

0 commit comments

Comments
 (0)