Skip to content

Commit 7a33a48

Browse files
committed
add oobt / acceptable testing for package release
1 parent a24f885 commit 7a33a48

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

oobt/oobt.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Out Of Box testing
2+
#
3+
# Run simple serparpi search
4+
#
5+
import serpapi
6+
import sys, os, pprint
7+
8+
print("initialize serpapi client")
9+
client = serpapi.Client({
10+
"api_key": os.getenv("API_KEY", "demo")
11+
})
12+
print("execute search")
13+
result = client.search({
14+
"q": "coffee",
15+
"location": "Austin,Texas",
16+
})
17+
print("display result:")
18+
pp = pprint.PrettyPrinter(indent=2)
19+
pp.pprint(result)
20+
print("------")
21+
if len(result) > 0:
22+
print("OK: Out of box tests passed")
23+
sys.exit(0)
24+
25+
print("FAIL: Out of box tests failed: no result")
26+
sys.exit(1)

0 commit comments

Comments
 (0)