""" 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)