1
0
mirror of https://github.com/ericchiang/pup synced 2025-01-15 10:11:16 +00:00
pup/tests/run.py
Wolfgang Faust 3b0097e9ed Modify tests to support multiple arguments.
Also, update tests for --number to actually check that flag.
Previously they were checking for a '-n' tag inside an 'li' tag,
producing the empty string.
I don't think this was the intended result.
2018-02-17 10:57:55 -05:00

15 lines
407 B
Python
Executable File

#!/usr/bin/env python
from __future__ import print_function
from hashlib import sha1
from subprocess import Popen, PIPE, STDOUT
data = open("index.html", "r").read()
for line in open("cmds.txt", "r"):
line = line.strip()
p = Popen(['pup']+line.split('\t'), stdout=PIPE, stdin=PIPE, stderr=PIPE)
h = sha1()
h.update(p.communicate(input=data)[0])
print("%s %s" % (h.hexdigest(), line))