2828 limitations under the License.
2929"""
3030
31- # Documentation strings format
32- __docformat__ = "restructuredtext en"
33-
34- # ------------------------------------------------------------------------------
35-
36- # Prepare Python path to import javaobj
31+ # Standard library
32+ import logging
33+ import subprocess
34+ import unittest
3735import os
3836import sys
39- sys .path .insert (0 , os .path .abspath (os .path .join (os .getcwd (), '..' )))
37+
38+ # Prepare Python path to import javaobj
39+ sys .path .insert (0 , os .path .abspath (os .path .dirname (os .getcwd ())))
4040
4141# Local
4242import javaobj
4343
44- # Standard library
45- import logging
46- import subprocess
47- import unittest
48-
4944# ------------------------------------------------------------------------------
5045
46+ # Documentation strings format
47+ __docformat__ = "restructuredtext en"
48+
5149_logger = logging .getLogger ("javaobj.tests" )
5250
5351# ------------------------------------------------------------------------------
5452
53+
5554class TestJavaobj (unittest .TestCase ):
5655 """
5756 Full test suite for javaobj
@@ -71,10 +70,9 @@ def setUpClass(cls):
7170 java_dir .append ('java' )
7271
7372 os .chdir (os .path .join (* java_dir ))
74- subprocess .call (['mvn' , 'test' ])
73+ subprocess .call (['mvn' , 'test' ], shell = True )
7574 os .chdir ('..' )
7675
77-
7876 def read_file (self , filename ):
7977 """
8078 Reads the content of the given file in binary mode
@@ -85,7 +83,6 @@ def read_file(self, filename):
8583 with open (filename , 'rb' ) as filep :
8684 return filep .read ()
8785
88-
8986 def test_char_rw (self ):
9087 """
9188 Reads testChar.ser and checks the serialization process
@@ -97,7 +94,6 @@ def test_char_rw(self):
9794 jobj_ = javaobj .dumps (pobj )
9895 self .assertEqual (jobj , jobj_ )
9996
100-
10197 def test_double_rw (self ):
10298 """
10399 Reads testDouble.ser and checks the serialization process
@@ -111,7 +107,6 @@ def test_double_rw(self):
111107 jobj_ = javaobj .dumps (pobj )
112108 self .assertEqual (jobj , jobj_ )
113109
114-
115110 def test_bytes_rw (self ):
116111 """
117112 Reads testBytes.ser and checks the serialization process
@@ -125,7 +120,6 @@ def test_bytes_rw(self):
125120 jobj_ = javaobj .dumps (pobj )
126121 self .assertEqual (jobj , jobj_ )
127122
128-
129123 def test_boolean (self ):
130124 """
131125 Reads testBoolean.ser and checks the serialization process
@@ -139,7 +133,6 @@ def test_boolean(self):
139133 jobj_ = javaobj .dumps (pobj )
140134 self .assertEqual (jobj , jobj_ )
141135
142-
143136 def test_byte (self ):
144137 """
145138 Reads testByte.ser
@@ -155,7 +148,6 @@ def test_byte(self):
155148 jobj_ = javaobj .dumps (pobj )
156149 self .assertEqual (jobj , jobj_ )
157150
158-
159151 def test_fields (self ):
160152 """
161153 Reads a serialized object and checks its fields
0 commit comments