Browse Source

Improve test coverage

tags/nilmdb-2.0.0
Jim Paris 4 years ago
parent
commit
f587518adb
2 changed files with 6 additions and 1 deletions
  1. +1
    -1
      nilmdb/client/httpclient.py
  2. +5
    -0
      tests/test_client.py

+ 1
- 1
nilmdb/client/httpclient.py View File

@@ -154,7 +154,7 @@ class HTTPClient(object):
pending = tmp[-1]
for line in lines:
yield line
if pending is not None: # pragma: no cover (missing newline)
if pending is not None:
yield pending

# Yield the chunks or lines as requested


+ 5
- 0
tests/test_client.py View File

@@ -100,6 +100,11 @@ class TestClient(object):
with assert_raises(Error):
client.http._handle_error(url, 600, json.dumps(args))

# Use get_gen for an endpoint that doesn't have newlines,
# for better test coverage.
for line in client.http.get_gen("/version"):
pass

client.close()

def test_client_02_createlist(self):


Loading…
Cancel
Save