Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
fix for linux and unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Aug 25, 2015
1 parent cb23e5b commit 3315c6c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions _unittests/ut_serverdoc/test_ping.py
Expand Up @@ -25,14 +25,22 @@


class TestPing(unittest.TestCase):

def get_machine(self):
if sys.platform.startswith("win"):
return os.environ["COMPUTERNAME"]
else:
r = os.environ.get("HOSTNAME", None)
if r is None:
raise Exception(str(os.environ))

def test_ping(self):
fLOG(
__file__,
self._testMethodName,
OutputPrint=__name__ == "__main__")

machine = os.environ["COMPUTERNAME"]
machine = self.get_machine()
out = ping_machine(machine, fLOG=fLOG)
fLOG(out)
assert len(out) > 0
Expand All @@ -43,7 +51,7 @@ def test_regular_ping(self):
self._testMethodName,
OutputPrint=__name__ == "__main__")

machine = os.environ["COMPUTERNAME"]
machine = self.get_machine()
out = regular_ping_machine(machine, delay=0.1, nb_max=3, fLOG=fLOG)
fLOG(out)
assert len(out) > 0
Expand Down

0 comments on commit 3315c6c

Please sign in to comment.