1818import unittest
1919
2020import mock
21- import six
21+ import io
2222
2323from gitlab import config
2424
@@ -80,26 +80,26 @@ def test_missing_config(self, path_exists):
8080 config .GitlabConfigParser ("test" )
8181
8282 @mock .patch ("os.path.exists" )
83- @mock .patch ("six.moves. builtins.open" )
83+ @mock .patch ("builtins.open" )
8484 def test_invalid_id (self , m_open , path_exists ):
85- fd = six .StringIO (no_default_config )
85+ fd = io .StringIO (no_default_config )
8686 fd .close = mock .Mock (return_value = None )
8787 m_open .return_value = fd
8888 path_exists .return_value = True
8989 config .GitlabConfigParser ("there" )
9090 self .assertRaises (config .GitlabIDError , config .GitlabConfigParser )
9191
92- fd = six .StringIO (valid_config )
92+ fd = io .StringIO (valid_config )
9393 fd .close = mock .Mock (return_value = None )
9494 m_open .return_value = fd
9595 self .assertRaises (
9696 config .GitlabDataError , config .GitlabConfigParser , gitlab_id = "not_there"
9797 )
9898
9999 @mock .patch ("os.path.exists" )
100- @mock .patch ("six.moves. builtins.open" )
100+ @mock .patch ("builtins.open" )
101101 def test_invalid_data (self , m_open , path_exists ):
102- fd = six .StringIO (missing_attr_config )
102+ fd = io .StringIO (missing_attr_config )
103103 fd .close = mock .Mock (return_value = None , side_effect = lambda : fd .seek (0 ))
104104 m_open .return_value = fd
105105 path_exists .return_value = True
@@ -117,9 +117,9 @@ def test_invalid_data(self, m_open, path_exists):
117117 self .assertEqual ("Unsupported per_page number: 200" , emgr .exception .args [0 ])
118118
119119 @mock .patch ("os.path.exists" )
120- @mock .patch ("six.moves. builtins.open" )
120+ @mock .patch ("builtins.open" )
121121 def test_valid_data (self , m_open , path_exists ):
122- fd = six .StringIO (valid_config )
122+ fd = io .StringIO (valid_config )
123123 fd .close = mock .Mock (return_value = None )
124124 m_open .return_value = fd
125125 path_exists .return_value = True
@@ -133,7 +133,7 @@ def test_valid_data(self, m_open, path_exists):
133133 self .assertEqual (True , cp .ssl_verify )
134134 self .assertIsNone (cp .per_page )
135135
136- fd = six .StringIO (valid_config )
136+ fd = io .StringIO (valid_config )
137137 fd .close = mock .Mock (return_value = None )
138138 m_open .return_value = fd
139139 cp = config .GitlabConfigParser (gitlab_id = "two" )
@@ -144,7 +144,7 @@ def test_valid_data(self, m_open, path_exists):
144144 self .assertEqual (10 , cp .timeout )
145145 self .assertEqual (False , cp .ssl_verify )
146146
147- fd = six .StringIO (valid_config )
147+ fd = io .StringIO (valid_config )
148148 fd .close = mock .Mock (return_value = None )
149149 m_open .return_value = fd
150150 cp = config .GitlabConfigParser (gitlab_id = "three" )
@@ -156,7 +156,7 @@ def test_valid_data(self, m_open, path_exists):
156156 self .assertEqual ("/path/to/CA/bundle.crt" , cp .ssl_verify )
157157 self .assertEqual (50 , cp .per_page )
158158
159- fd = six .StringIO (valid_config )
159+ fd = io .StringIO (valid_config )
160160 fd .close = mock .Mock (return_value = None )
161161 m_open .return_value = fd
162162 cp = config .GitlabConfigParser (gitlab_id = "four" )
0 commit comments