summaryrefslogtreecommitdiff
path: root/t/test.py
diff options
context:
space:
mode:
Diffstat (limited to 't/test.py')
-rw-r--r--t/test.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/t/test.py b/t/test.py
index b0bf7fa..f7ca98e 100644
--- a/t/test.py
+++ b/t/test.py
@@ -185,7 +185,11 @@ class TestTftpyState(unittest.TestCase):
else:
server.listen('localhost', 20001)
- def clientServerDownloadOptions(self, options, output='/tmp/out'):
+ def clientServerDownloadOptions(self,
+ options,
+ output='/tmp/out',
+ cretries=tftpy.DEF_TIMEOUT_RETRIES,
+ sretries=tftpy.DEF_TIMEOUT_RETRIES):
"""Fire up a client and a server and do a download."""
root = os.path.dirname(os.path.abspath(__file__))
server = tftpy.TftpServer(root)
@@ -199,13 +203,14 @@ class TestTftpyState(unittest.TestCase):
try:
time.sleep(1)
client.download('640KBFILE',
- output)
+ output,
+ retries=cretries)
finally:
os.kill(child_pid, 15)
os.waitpid(child_pid, 0)
else:
- server.listen('localhost', 20001)
+ server.listen('localhost', 20001, retries=sretries)
@contextmanager
def dummyServerDir(self):
@@ -223,6 +228,9 @@ class TestTftpyState(unittest.TestCase):
def testClientServerNoOptions(self):
self.clientServerDownloadOptions({})
+ def testClientServerNoOptionsRetries(self):
+ self.clientServerDownloadOptions({}, cretries=5, sretries=5)
+
def testClientServerTsizeOptions(self):
self.clientServerDownloadOptions({'tsize': 64*1024})