13
13
logger = logging .getLogger (__name__ )
14
14
15
15
16
- @unittest .skip ('test' )
17
16
class TmuxObjectTest (TmuxTestCase ):
18
17
19
18
''' test the :class:`TmuxRelationalObject` base class object.
@@ -25,7 +24,6 @@ def test_findWhere(self):
25
24
# server.findWhere
26
25
for session in t .sessions :
27
26
session_id = session .get ('session_id' )
28
- logger .error (session_id )
29
27
30
28
self .assertEqual (t .findWhere ({'session_id' : session_id }), session )
31
29
self .assertIsInstance (t .findWhere ({
@@ -35,10 +33,12 @@ def test_findWhere(self):
35
33
for window in session .windows :
36
34
window_id = window .get ('window_id' )
37
35
38
- self .assertEqual (session .findWhere (
39
- {'window_id' : window_id }), window )
40
- self .assertIsInstance (session .findWhere (
41
- {'window_id' : window_id }), Window )
36
+ self .assertEqual (
37
+ session .findWhere ({'window_id' : window_id }), window
38
+ )
39
+ self .assertIsInstance (
40
+ session .findWhere ({'window_id' : window_id }), Window
41
+ )
42
42
43
43
# window.findWhere
44
44
for pane in window .panes :
@@ -53,7 +53,7 @@ def test_findWhere_multiple_attrs(self):
53
53
'''.findWhere returns objects with multiple attributes
54
54
'''
55
55
56
- for session in t ._sessions :
56
+ for session in t .sessions :
57
57
session_id = session .get ('session_id' )
58
58
session_name = session .get ('session_name' )
59
59
find_where = t .findWhere ({
@@ -96,7 +96,7 @@ def test_where(self):
96
96
window = self .session .attached_window ()
97
97
window .split_window () # create second pane
98
98
99
- for session in t ._sessions :
99
+ for session in t .sessions :
100
100
session_id = session .get ('session_id' )
101
101
session_name = session .get ('session_name' )
102
102
where = t .where ({
@@ -146,7 +146,7 @@ def test_getById(self):
146
146
147
147
window .split_window () # create second pane
148
148
149
- for session in t ._sessions :
149
+ for session in t .sessions :
150
150
session_id = session .get ('session_id' )
151
151
session_name = session .get ('session_name' )
152
152
get_by_id = t .getById (session_id )
@@ -184,51 +184,5 @@ def test_getById(self):
184
184
'%' + str (random .randint (50000 , 90000 ))
185
185
))
186
186
187
-
188
- class ReferenceTestCase (TmuxTestCase ):
189
-
190
- @unittest .skip ('not doing yet, complete unit tests first' )
191
- def test_mutability (self ):
192
- # window = self.session.attached_window()
193
-
194
- # window.split_window() # create second pane
195
-
196
- for session in t ._sessions :
197
- session_id = session .get ('session_id' )
198
- session_name = session .get ('session_name' )
199
- get_by_id = t .getById (session_id )
200
-
201
- for x in range (random .randint (1 , 6 )):
202
- window = session .new_window ()
203
-
204
- for window in session .windows :
205
- for y in range (random .randint (1 , 3 )):
206
- try :
207
- pane = window .split_window ()
208
- except Exception as e :
209
- logger .debug (e )
210
- pass
211
-
212
- # session.getById
213
- last_window = None
214
- for window in session .windows :
215
- window_id = window .get ('window_id' )
216
- window_index = window .get ('window_index' )
217
-
218
- if last_window :
219
- self .assertEqual (last_window .session , window .session )
220
- self .assertEqual (id (
221
- last_window .session ), id (window .session ))
222
- self .assertNotEqual (last_window , window )
223
- self .assertNotEqual (id (last_window ), id (window ))
224
- last_window = window
225
-
226
- # window.getById
227
- for pane in window .panes :
228
- pane_id = pane .get ('pane_id' )
229
- pane_tty = pane .get ('pane_tty' )
230
-
231
- get_by_id = window .getById (pane_id )
232
-
233
187
if __name__ == '__main__' :
234
188
unittest .main ()
0 commit comments