@@ -0,0 +1,1500 @@
+#!/usr/bin/env python%0A# coding=utf-8%0A%0Atry:%0A    import unittest.mock as mock%0Aexcept ImportError:%0A    import mock%0Aimport unittest%0Atry: %0A    from StringIO import StringIO%0Aexcept ImportError:%0A    from io import StringIO%0A%0Afrom nessusapi.session import Session%0Afrom nessusapi.session import Request%0A%0Aclass SessionTestCase(unittest.TestCase):%0A    @mock.patch('nessusapi.session.random')%0A    @mock.patch('nessusapi.session.urlopen')%0A    @mock.patch('nessusapi.session.Request')%0A    def test_init(self, mock_request, mock_urlopen, mock_random):%0A        mock_random.randrange.return_value = 2811%0A        mock_urlopen.return_value = StringIO('%3C?xml version=%221.0%22?%3E %3Creply%3E'%0A                                             %22%3Cseq%3E2811%3C/seq%3E%22%0A                                             %22%3Cstatus%3EOK%3C/status%3E%22%0A                                             %22%3Ccontents%3E%3Ctoken%3Ece65ea7%3C/token%3E%22%0A                                             %22%3Cuser%3E%22%0A                                             %22%3Cname%3Eadmin%3C/name%3E%22%0A                                             %22%3Cadmin%3ETRUE%3C/admin%3E%22%0A                                             %22%3C/user%3E%3C/contents%3E%22%0A                                             %22%3C/reply%3E%22)%0A        session = Session('user', 'pass', '192.0.2.3', '8980')%0A        mock_request.assert_called_once_with('https://192.0.2.3:8980/login',%0A                                        'login=user&password=pass&seq=2811')%0A        self.assertEqual(session.token, %22ce65ea7%22)%0A%0A%0Aif __name__ == '__main__':%0A    unittest.main()%0A

Add basic tests for session