summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLucas Hoffmann <l-m-h@web.de>2017-05-12 09:18:20 +0200
committerLucas Hoffmann <l-m-h@web.de>2017-05-12 17:10:18 +0200
commitd43736e5281ce5cfd0c37e28eb7f8ac041c88396 (patch)
treecc77e330ea894d5205a6f4a0bfc313d0a61f35e3 /tests
parent9d5569fb39517a976834198a637cea39db7e2fdf (diff)
downloadvdebug-d43736e5281ce5cfd0c37e28eb7f8ac041c88396.zip
Remove dependency on unittest2
Diffstat (limited to 'tests')
-rw-r--r--tests/test_breakpoint_breakpoint.py2
-rw-r--r--tests/test_dbgp_api.py4
-rw-r--r--tests/test_dbgp_connection.py8
-rw-r--r--tests/test_dbgp_context_property.py2
-rw-r--r--tests/test_dbgp_eval_property.py6
-rw-r--r--tests/test_dbgp_response.py34
-rw-r--r--tests/test_opts_options.py2
-rw-r--r--tests/test_util_environment.py2
-rw-r--r--tests/test_util_filepath.py2
9 files changed, 31 insertions, 31 deletions
diff --git a/tests/test_breakpoint_breakpoint.py b/tests/test_breakpoint_breakpoint.py
index 865a3ae..5fc7121 100644
--- a/tests/test_breakpoint_breakpoint.py
+++ b/tests/test_breakpoint_breakpoint.py
@@ -1,7 +1,7 @@
if __name__ == "__main__":
import sys
sys.path.append('../plugin/python/')
-import unittest2 as unittest
+import unittest
import vdebug.breakpoint
import vdebug.util
import base64
diff --git a/tests/test_dbgp_api.py b/tests/test_dbgp_api.py
index f255181..74bc67f 100644
--- a/tests/test_dbgp_api.py
+++ b/tests/test_dbgp_api.py
@@ -1,11 +1,11 @@
if __name__ == "__main__":
import sys
sys.path.append('../plugin/python/')
-import unittest2 as unittest
+import unittest
import vdebug.dbgp
from mock import MagicMock, patch
-class ApiTest(unittest.TestCase):
+class ApiTest(unittest.TestCase):
"""Test the Api class in the vdebug.dbgp module."""
init_msg = """<?xml version="1.0"
diff --git a/tests/test_dbgp_connection.py b/tests/test_dbgp_connection.py
index 9a2407e..cc67610 100644
--- a/tests/test_dbgp_connection.py
+++ b/tests/test_dbgp_connection.py
@@ -1,7 +1,7 @@
if __name__ == "__main__":
import sys
sys.path.append('../plugin/python/')
-import unittest2 as unittest
+import unittest
import vdebug.dbgp
class SocketMockError():
@@ -41,7 +41,7 @@ class SocketMock():
pass
-class ConnectionTest(unittest.TestCase):
+class ConnectionTest(unittest.TestCase):
def setUp(self):
self.conn = vdebug.dbgp.Connection('', 0)
@@ -81,8 +81,8 @@ class ConnectionTest(unittest.TestCase):
self.conn.sock.add_response('')
self.assertRaises(EOFError,self.conn.recv_msg)
- """
- Test that the send_msg command calls send on the socket,
+ """
+ Test that the send_msg command calls send on the socket,
and adds a null byte to the string.
"""
def test_send(self):
diff --git a/tests/test_dbgp_context_property.py b/tests/test_dbgp_context_property.py
index 5c7cb41..4e8aa67 100644
--- a/tests/test_dbgp_context_property.py
+++ b/tests/test_dbgp_context_property.py
@@ -1,7 +1,7 @@
if __name__ == "__main__":
import sys
sys.path.append('../plugin/python/')
-import unittest2 as unittest
+import unittest
import vdebug.dbgp
import xml.etree.ElementTree as ET
diff --git a/tests/test_dbgp_eval_property.py b/tests/test_dbgp_eval_property.py
index 32ab2fe..4076e77 100644
--- a/tests/test_dbgp_eval_property.py
+++ b/tests/test_dbgp_eval_property.py
@@ -1,7 +1,7 @@
if __name__ == "__main__":
import sys
sys.path.append('../plugin/python/')
-import unittest2 as unittest
+import unittest
import vdebug.dbgp
import xml.etree.ElementTree as ET
@@ -15,13 +15,13 @@ class EvalPropertyTest(unittest.TestCase):
prop = self.__get_eval_property(\
"""<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="13">
- <property
+ <property
address="140722906708544" type="array"
children="1" numchildren="2" page="0" pagesize="32">
<property
name="0" address="140022315302704"
type="array" children="1" numchildren="1"></property>
- <property
+ <property
name="key" address="140022315307008"
type="array" children="1" numchildren="1"></property>
</property>
diff --git a/tests/test_dbgp_response.py b/tests/test_dbgp_response.py
index c302884..82aac43 100644
--- a/tests/test_dbgp_response.py
+++ b/tests/test_dbgp_response.py
@@ -1,12 +1,12 @@
import sys
if __name__ == "__main__":
sys.path.append('../plugin/python/')
-import unittest2 as unittest
+import unittest
import vdebug.dbgp
import xml
from mock import Mock
-class ResponseTest(unittest.TestCase):
+class ResponseTest(unittest.TestCase):
"""Test the response class in the vdebug.dbgp module."""
def test_get_cmd(self):
@@ -35,15 +35,15 @@ class ResponseTest(unittest.TestCase):
element"""
response = """<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1"
- xmlns:xdebug="http://xdebug.org/dbgp/xdebug"
- command="status" transaction_id="1" status="starting"
+ xmlns:xdebug="http://xdebug.org/dbgp/xdebug"
+ command="status" transaction_id="1" status="starting"
reason="ok"></response>"""
res = vdebug.dbgp.Response(response,"","",Mock())
self.assertIsInstance(res.as_xml(),xml.etree.ElementTree.Element)
def test_error_tag_raises_exception(self):
response = """<?xml version="1.0" encoding="iso-8859-1"?>
- <response xmlns="urn:debugger_protocol_v1"
+ <response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug"
command="stack_get" transaction_id="4"><error
code="5"><message><![CDATA[command is not available]]>
@@ -51,42 +51,42 @@ class ResponseTest(unittest.TestCase):
re = "command is not available"
self.assertRaisesRegexp(vdebug.dbgp.DBGPError,re,vdebug.dbgp.Response,response,"","",Mock())
-class StatusResponseTest(unittest.TestCase):
+class StatusResponseTest(unittest.TestCase):
"""Test the behaviour of the StatusResponse class."""
def test_string_is_status_text(self):
response = """<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1"
- xmlns:xdebug="http://xdebug.org/dbgp/xdebug"
- command="status" transaction_id="1" status="starting"
+ xmlns:xdebug="http://xdebug.org/dbgp/xdebug"
+ command="status" transaction_id="1" status="starting"
reason="ok"></response>"""
res = vdebug.dbgp.StatusResponse(response,"","",Mock())
assert str(res) == "starting"
-class FeatureResponseTest(unittest.TestCase):
+class FeatureResponseTest(unittest.TestCase):
"""Test the behaviour of the FeatureResponse class."""
def test_feature_is_supported(self):
response = """<?xml version="1.0" encoding="iso-8859-1"?>
- <response xmlns="urn:debugger_protocol_v1"
- xmlns:xdebug="http://xdebug.org/dbgp/xdebug"
- command="feature_get" transaction_id="2"
+ <response xmlns="urn:debugger_protocol_v1"
+ xmlns:xdebug="http://xdebug.org/dbgp/xdebug"
+ command="feature_get" transaction_id="2"
feature_name="max_depth" supported="1"><![CDATA[1]]></response>"""
res = vdebug.dbgp.FeatureGetResponse(response,"","",Mock())
assert res.is_supported() == 1
def test_feature_is_not_supported(self):
response = """<?xml version="1.0" encoding="iso-8859-1"?>
- <response xmlns="urn:debugger_protocol_v1"
- xmlns:xdebug="http://xdebug.org/dbgp/xdebug"
- command="feature_get" transaction_id="2"
+ <response xmlns="urn:debugger_protocol_v1"
+ xmlns:xdebug="http://xdebug.org/dbgp/xdebug"
+ command="feature_get" transaction_id="2"
feature_name="max_depth" supported="0"><![CDATA[0]]></response>"""
res = vdebug.dbgp.FeatureGetResponse(response,"","",Mock())
assert res.is_supported() == 0
-class StackGetTest(unittest.TestCase):
+class StackGetTest(unittest.TestCase):
"""Test the behaviour of the StackGetResponse class."""
def test_string_is_status_text(self):
response = """<?xml version="1.0" encoding="iso-8859-1"?>
- <response xmlns="urn:debugger_protocol_v1"
+ <response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug"
command="stack_get" transaction_id="8">
<stack where="{main}" level="0" type="file"
diff --git a/tests/test_opts_options.py b/tests/test_opts_options.py
index 3e6916b..41438fb 100644
--- a/tests/test_opts_options.py
+++ b/tests/test_opts_options.py
@@ -1,7 +1,7 @@
if __name__ == "__main__":
import sys
sys.path.append('../plugin/python/')
-import unittest2 as unittest
+import unittest
from vdebug.opts import Options,OptionsError
class OptionsTest(unittest.TestCase):
diff --git a/tests/test_util_environment.py b/tests/test_util_environment.py
index f4ea4a4..75707e7 100644
--- a/tests/test_util_environment.py
+++ b/tests/test_util_environment.py
@@ -1,7 +1,7 @@
if __name__ == "__main__":
import sys
sys.path.append('../plugin/python/')
-import unittest2 as unittest
+import unittest
""" Mock vim import """
import vdebug.log
import vim
diff --git a/tests/test_util_filepath.py b/tests/test_util_filepath.py
index 57d507a..f470aab 100644
--- a/tests/test_util_filepath.py
+++ b/tests/test_util_filepath.py
@@ -1,7 +1,7 @@
if __name__ == "__main__":
import sys
sys.path.append('../plugin/python/')
-import unittest2 as unittest
+import unittest
import vdebug.opts
from vdebug.util import FilePath,FilePathError