diff options
author | Christian Franke <nobody@nowhere.ws> | 2012-01-11 09:49:53 +0100 |
---|---|---|
committer | Christian Franke <nobody@nowhere.ws> | 2012-01-11 09:49:53 +0100 |
commit | 9a94e0095a51981cc668ac0269667a307c45923c (patch) | |
tree | 76a92a43a24b0a7b376912e310353677c746c074 /sublab_project/sublab_monitor/tests.py | |
parent | fff2edd3a10a7f9585d4a734740420256246b9b5 (diff) |
add network_monitor
Diffstat (limited to 'sublab_project/sublab_monitor/tests.py')
-rw-r--r-- | sublab_project/sublab_monitor/tests.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sublab_project/sublab_monitor/tests.py b/sublab_project/sublab_monitor/tests.py new file mode 100644 index 0000000..c80bb61 --- /dev/null +++ b/sublab_project/sublab_monitor/tests.py @@ -0,0 +1,24 @@ +""" +This file demonstrates writing tests using the unittest module. These will pass +when you run "manage.py test". + +Replace this with more appropriate tests for your application. +""" + +from django.test import TestCase +from sublab_monitor.tasks import NetworkStatus + +class SimpleTest(TestCase): + def test_reachable(self): + """ + Tests that for reachable hosts host_alive() returns True + """ + self.assertEqual(NetworkStatus.host_alive('127.0.0.1'), True) + + def test_unreachable(self): + """ + Tests that for unreachable hosts host_alive() returns False + """ + # Hopefully, this DoD? IP will never be reachable on the + # Internet :) + self.assertEqual(NetworkStatus.host_alive('8.5.4.3'), False) |