p1 = wrapper.invoke(a1, "poll")
p2 = wrapper.invoke(a2, "poll")
- stdout1 = open(path1, "r")
- stdout2 = open(path2, "r")
+ with open(path1, "r") as stdout1:
+ with open(path2, "r") as stdout2:
- s1 = stdout1.read()
- s2 = stdout2.read()
+ s1 = stdout1.read()
+ s2 = stdout2.read()
expected = "1 packets transmitted, 1 received, 0% packet loss"
self.assertTrue(s1.find(expected) > -1)