Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 7a4e039

Browse files
committed
also test keyvalue
1 parent 8d92205 commit 7a4e039

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

examples/keyvalue/keyvalue/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def run():
3737
# Note: When using Hyperbahn this `hostport` option is *NOT NEEDED*.
3838
client = KeyValueClient(app, hostport='localhost:8889')
3939

40-
yield client.setValue("foo", "bar")
40+
yield client.setValue("foo", "Hello, world!")
4141

4242
response = yield client.getValue("foo")
4343

tests/test_examples.py

+14-8
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,11 @@
2626

2727

2828
@contextlib.contextmanager
29-
def popen(path, pipe=subprocess.PIPE):
30-
29+
def popen(path):
3130
process = subprocess.Popen(
3231
['python', path],
33-
stdout=pipe,
34-
stderr=pipe,
32+
stdout=subprocess.PIPE,
33+
stderr=subprocess.PIPE,
3534
)
3635
process.poll()
3736

@@ -58,21 +57,28 @@ def examples_dir():
5857

5958
@pytest.mark.parametrize(
6059
'example_type',
61-
['raw', 'thrift_examples/thrift', 'json']#, 'stream'],
60+
[
61+
'raw_',
62+
'json_',
63+
'thrift_examples/thrift_',
64+
'keyvalue/keyvalue/',
65+
#'stream_',
66+
]
6267
)
6368
def test_example(examples_dir, example_type):
69+
"""Smoke test example code to ensure it still runs."""
6470

6571
server_path = os.path.join(
6672
examples_dir,
67-
example_type + '_server.py',
73+
example_type + 'server.py',
6874
)
6975

7076
client_path = os.path.join(
7177
examples_dir,
72-
example_type + '_client.py',
78+
example_type + 'client.py',
7379
)
7480

75-
with popen(server_path, pipe=None):
81+
with popen(server_path):
7682
# :(
7783
import time
7884
time.sleep(0.01)

0 commit comments

Comments
 (0)