18
18
import unittest
19
19
20
20
import mock
21
- import six
21
+ import io
22
22
23
23
from gitlab import config
24
24
@@ -80,26 +80,26 @@ def test_missing_config(self, path_exists):
80
80
config .GitlabConfigParser ("test" )
81
81
82
82
@mock .patch ("os.path.exists" )
83
- @mock .patch ("six.moves. builtins.open" )
83
+ @mock .patch ("builtins.open" )
84
84
def test_invalid_id (self , m_open , path_exists ):
85
- fd = six .StringIO (no_default_config )
85
+ fd = io .StringIO (no_default_config )
86
86
fd .close = mock .Mock (return_value = None )
87
87
m_open .return_value = fd
88
88
path_exists .return_value = True
89
89
config .GitlabConfigParser ("there" )
90
90
self .assertRaises (config .GitlabIDError , config .GitlabConfigParser )
91
91
92
- fd = six .StringIO (valid_config )
92
+ fd = io .StringIO (valid_config )
93
93
fd .close = mock .Mock (return_value = None )
94
94
m_open .return_value = fd
95
95
self .assertRaises (
96
96
config .GitlabDataError , config .GitlabConfigParser , gitlab_id = "not_there"
97
97
)
98
98
99
99
@mock .patch ("os.path.exists" )
100
- @mock .patch ("six.moves. builtins.open" )
100
+ @mock .patch ("builtins.open" )
101
101
def test_invalid_data (self , m_open , path_exists ):
102
- fd = six .StringIO (missing_attr_config )
102
+ fd = io .StringIO (missing_attr_config )
103
103
fd .close = mock .Mock (return_value = None , side_effect = lambda : fd .seek (0 ))
104
104
m_open .return_value = fd
105
105
path_exists .return_value = True
@@ -117,9 +117,9 @@ def test_invalid_data(self, m_open, path_exists):
117
117
self .assertEqual ("Unsupported per_page number: 200" , emgr .exception .args [0 ])
118
118
119
119
@mock .patch ("os.path.exists" )
120
- @mock .patch ("six.moves. builtins.open" )
120
+ @mock .patch ("builtins.open" )
121
121
def test_valid_data (self , m_open , path_exists ):
122
- fd = six .StringIO (valid_config )
122
+ fd = io .StringIO (valid_config )
123
123
fd .close = mock .Mock (return_value = None )
124
124
m_open .return_value = fd
125
125
path_exists .return_value = True
@@ -133,7 +133,7 @@ def test_valid_data(self, m_open, path_exists):
133
133
self .assertEqual (True , cp .ssl_verify )
134
134
self .assertIsNone (cp .per_page )
135
135
136
- fd = six .StringIO (valid_config )
136
+ fd = io .StringIO (valid_config )
137
137
fd .close = mock .Mock (return_value = None )
138
138
m_open .return_value = fd
139
139
cp = config .GitlabConfigParser (gitlab_id = "two" )
@@ -144,7 +144,7 @@ def test_valid_data(self, m_open, path_exists):
144
144
self .assertEqual (10 , cp .timeout )
145
145
self .assertEqual (False , cp .ssl_verify )
146
146
147
- fd = six .StringIO (valid_config )
147
+ fd = io .StringIO (valid_config )
148
148
fd .close = mock .Mock (return_value = None )
149
149
m_open .return_value = fd
150
150
cp = config .GitlabConfigParser (gitlab_id = "three" )
@@ -156,7 +156,7 @@ def test_valid_data(self, m_open, path_exists):
156
156
self .assertEqual ("/path/to/CA/bundle.crt" , cp .ssl_verify )
157
157
self .assertEqual (50 , cp .per_page )
158
158
159
- fd = six .StringIO (valid_config )
159
+ fd = io .StringIO (valid_config )
160
160
fd .close = mock .Mock (return_value = None )
161
161
m_open .return_value = fd
162
162
cp = config .GitlabConfigParser (gitlab_id = "four" )
0 commit comments