fixed a typo in the unittst
authorsalimfadhley <sal@stodge.org>
Mon, 17 Jun 2013 23:51:56 +0000 (00:51 +0100)
committerSalim Fadhley <sal@stodge.org>
Sun, 23 Jun 2013 20:21:51 +0000 (21:21 +0100)
jenkinsapi_tests/unittests/test_node.py

index e595838..daf947b 100644 (file)
@@ -1,6 +1,5 @@
 import mock
 import unittest
-import datetime
 
 from jenkinsapi.node import Node
 
@@ -47,10 +46,12 @@ class TestNode(unittest.TestCase):
     def testName(self):
         with self.assertRaises(AttributeError):
             self.n.id()
+        self.assertEquals(self.n.name, 'bobnit')
 
-    def test_online(self):
-        return assertEquals(self.n, True)
-
-
+    @mock.patch.object(Node, '_poll')
+    def test_online(self, _poll):
+        _poll.return_value = self.DATA
+        return self.assertEquals(self.n.is_online(), True)
 
-        self.assertEquals(self.n.name, 'bobnit')
+if __name__ == '__main__':
+    unittest.main()