summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Karl Ramm <kcr@1ts.org>2009-10-12 15:42:52 +0000
committerGravatar Karl Ramm <kcr@1ts.org>2009-10-12 15:42:52 +0000
commit3fb0a6a2aeb30a40c6bbd73853a5acfb1bc9eec9 (patch)
tree36561e04f1526b019c29ca490bf25d1b848732de
parente26aefd516b395c6ecc438722e94f717d9fa7a2c (diff)
Print only some fields of ZGetDestAddr to dodge sin_len
Print only the fields of ZGetDestAddr we care about checking -- the address family and address. We can't just print the whole structure and selectively examine fields, because we can't easily determine whether sin_len will be present or not. (from Ken Raeburn)
-rw-r--r--lib/zephyr_tests.txt13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/zephyr_tests.txt b/lib/zephyr_tests.txt
index 2548471..e3fe0ab 100644
--- a/lib/zephyr_tests.txt
+++ b/lib/zephyr_tests.txt
@@ -188,13 +188,12 @@ Trivial test of ZOpenPort and ZClosePort:
also cast it to sockaddr_in and look at the address and port...)
>>> assert port != 0
- >>> zephyr_tests.ctypes_pprint(_z.ZGetDestAddr())
- ... # doctest: +ELLIPSIS
- sin_family AF_INET(2)
- sin_port ...
- sin_addr 127.0.0.1
- sin_zero [ignored]
-
+ >>> print type(_z.ZGetDestAddr())
+ <class 'zephyr.sockaddr_in'>
+ >>> print _z.ZGetDestAddr().sin_family.pformat()
+ ['AF_INET(2)']
+ >>> print _z.ZGetDestAddr().sin_addr.pformat()
+ ['127.0.0.1']
>>> assert _z.ZClosePort() == 0
>>> assert _z.ZGetFD() == -1