aboutsummaryrefslogtreecommitdiff
path: root/test/py/test_dma_map.py
diff options
context:
space:
mode:
authorJohn Levon <levon@movementarian.org>2021-10-22 13:56:38 +0100
committerGitHub <noreply@github.com>2021-10-22 13:56:38 +0100
commit7fd786fa7f0023e7bf74618c6ebc3999f5736bc6 (patch)
tree79a152071fe31d3f6bd0b5e1fbecabc310e3c895 /test/py/test_dma_map.py
parent3111d8ec3ed5557b64434778fb2596908235bfa2 (diff)
downloadlibvfio-user-7fd786fa7f0023e7bf74618c6ebc3999f5736bc6.zip
libvfio-user-7fd786fa7f0023e7bf74618c6ebc3999f5736bc6.tar.gz
libvfio-user-7fd786fa7f0023e7bf74618c6ebc3999f5736bc6.tar.bz2
run python code through flake8 (#613)
Aside from general style goodness, this found a couple of accidental re-definitions, so it's worth taking the pain now. Also, only run rstlint as part of pre-push. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
Diffstat (limited to 'test/py/test_dma_map.py')
-rw-r--r--test/py/test_dma_map.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/py/test_dma_map.py b/test/py/test_dma_map.py
index e4ac2ba..f446efd 100644
--- a/test/py/test_dma_map.py
+++ b/test/py/test_dma_map.py
@@ -36,11 +36,12 @@ import errno
ctx = None
+
def test_dma_region_too_big():
global ctx
ctx = prepare_ctx_for_dma()
- assert ctx != None
+ assert ctx is not None
sock = connect_client(ctx)
@@ -53,6 +54,7 @@ def test_dma_region_too_big():
disconnect_client(ctx, sock)
+
def test_dma_region_too_many():
sock = connect_client(ctx)
@@ -63,13 +65,14 @@ def test_dma_region_too_many():
offset=0, addr=0x1000 * i, size=4096)
if i == MAX_DMA_REGIONS + 1:
- expect=errno.EINVAL
+ expect = errno.EINVAL
else:
- expect=0
+ expect = 0
msg(ctx, sock, VFIO_USER_DMA_MAP, payload, expect=expect)
disconnect_client(ctx, sock)
+
def test_dma_region_cleanup():
vfu_destroy_ctx(ctx)