Package: x2gobroker / 0.0.4.3-4.3

1004_remove_nose_usage.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
--- a/x2gobroker/tests/test_web_plain_base.py
+++ b/x2gobroker/tests/test_web_plain_base.py
@@ -21,7 +21,6 @@
 import unittest
 import tempfile
 from paste.fixture import TestApp
-from nose.tools import assert_equal
 import tornado.wsgi
 
 # Python X2GoBroker modules
@@ -47,7 +46,7 @@
         x2gobroker.defaults.X2GOBROKER_CONFIG = tf.name
         testApp = TestApp(application)
         r = testApp.get('/plain/base/', expect_errors=True)
-        assert_equal(r.status, 404)
+        assert r.status == 404
         tf.close()
         _config = """
 [broker_base]
@@ -59,7 +58,7 @@
         x2gobroker.defaults.X2GOBROKER_CONFIG = tf.name
         testApp = TestApp(application)
         r = testApp.get('/plain/base/', expect_errors=True)
-        assert_equal(r.status, 401)
+        assert r.status == 401
         tf.close()
         x2gobroker.defaults.X2GOBROKER_CONFIG = _cf_bak
 
@@ -68,7 +67,7 @@
     def test_checkaccess(self):
         testApp = TestApp(application)
         r = testApp.get('/plain/base/', expect_errors=True)
-        assert_equal(r.status, 404)
+        assert r.status == 404
         _config = """
 [broker_base]
 enable = true
@@ -80,7 +79,7 @@
         _cf_bak = x2gobroker.defaults.X2GOBROKER_CONFIG
         x2gobroker.defaults.X2GOBROKER_CONFIG = tf.name
         r = testApp.get('/plain/base/', params={'user': 'test', 'password': 'sweet', }, expect_errors=True)
-        assert_equal(r.status, 200)
+        assert r.status == 200
         r.mustcontain('Access granted')
         x2gobroker.defaults.X2GOBROKER_CONFIG = _cf_bak
 
@@ -89,7 +88,7 @@
     def test_checkaccess_user_and_login(self):
         testApp = TestApp(application)
         r = testApp.get('/plain/base/', expect_errors=True)
-        assert_equal(r.status, 404)
+        assert r.status == 404
         _config = """
 [broker_base]
 enable = true
@@ -101,7 +100,7 @@
         _cf_bak = x2gobroker.defaults.X2GOBROKER_CONFIG
         x2gobroker.defaults.X2GOBROKER_CONFIG = tf.name
         r = testApp.get('/plain/base/', params={'user': 'test', 'login': 'test_user_on_server', 'password': 'sweet', }, expect_errors=True)
-        assert_equal(r.status, 200)
+        assert r.status == 200
         r.mustcontain('Access granted')
         x2gobroker.defaults.X2GOBROKER_CONFIG = _cf_bak
 
@@ -110,7 +109,7 @@
     def test_checkaccess_with_accentuated_chars(self):
         testApp = TestApp(application)
         r = testApp.get('/plain/base/', expect_errors=True)
-        assert_equal(r.status, 404)
+        assert r.status == 404
         _config = """
 [broker_base]
 enable = true
@@ -122,7 +121,7 @@
         _cf_bak = x2gobroker.defaults.X2GOBROKER_CONFIG
         x2gobroker.defaults.X2GOBROKER_CONFIG = tf.name
         r = testApp.get('/plain/base/', params={'user': 'jacques', 'password': 'thérèse', }, expect_errors=True)
-        assert_equal(r.status, 200)
+        assert r.status == 200
         r.mustcontain('Access granted')
         x2gobroker.defaults.X2GOBROKER_CONFIG = _cf_bak
 
@@ -141,7 +140,7 @@
         x2gobroker.defaults.X2GOBROKER_CONFIG = tf.name
         testApp = TestApp(application)
         r = testApp.get('/plain/base/', params={'user': 'test', 'password': 'sweet',  'task': 'listsessions', }, expect_errors=True)
-        assert_equal(r.status, 200)
+        assert r.status == 200
         r.mustcontain('Access granted')
         r.mustcontain(no='START_USER_SESSIONS')
         r.mustcontain(no='END_USER_SESSIONS')
--- a/x2gobroker/tests/test_web_plain_zeroconf.py
+++ b/x2gobroker/tests/test_web_plain_zeroconf.py
@@ -21,7 +21,6 @@
 import unittest
 import tempfile
 from paste.fixture import TestApp
-from nose.tools import assert_equal
 import tornado.wsgi
 
 # Python X2GoBroker modules
@@ -48,7 +47,7 @@
         x2gobroker.defaults.X2GOBROKER_CONFIG = tf.name
         testApp = TestApp(application)
         r = testApp.get('/plain/zeroconf/', params={'user': 'test', 'password': 'sweet',  'task': 'listsessions', }, expect_errors=True)
-        assert_equal(r.status, 200)
+        assert r.status == 200
         r.mustcontain('Access granted')
         r.mustcontain('START_USER_SESSIONS')
         r.mustcontain('command=KDE')
@@ -70,7 +69,7 @@
         x2gobroker.defaults.X2GOBROKER_CONFIG = tf.name
         testApp = TestApp(application)
         r = testApp.get('/plain/zeroconf/', params={'user': 'test', 'password': 'sweet',  'task': 'listsessions', }, expect_errors=True)
-        assert_equal(r.status, 200)
+        assert r.status == 200
         r.mustcontain('Access granted')
         r.mustcontain('START_USER_SESSIONS')
         r.mustcontain('command=GNOME')
@@ -95,7 +94,7 @@
         x2gobroker.defaults.X2GOBROKER_CONFIG = tf.name
         testApp = TestApp(application)
         r = testApp.get('/plain/zeroconf/', params={'user': 'test', 'password': 'sweet',  'task': 'selectsession', 'sid': 'LOCALHOST',}, expect_errors=True)
-        assert_equal(r.status, 200)
+        assert r.status == 200
         r.mustcontain('Access granted')
         r.mustcontain('SERVER:localhost:22')
         r.mustcontain(no='<BR>',)
--- a/x2gobroker/tests/test_web_uccs_zeroconf.py
+++ b/x2gobroker/tests/test_web_uccs_zeroconf.py
@@ -21,7 +21,6 @@
 import unittest
 import tempfile
 from paste.fixture import TestApp
-from nose.tools import assert_equal
 import tornado.wsgi
 import json
 
@@ -81,7 +80,7 @@
         headers = {}
 
         r = testApp.get('/uccs/zeroconf/api/4', headers=headers, expect_errors=True)
-        assert_equal(r.status, 200)
+        assert r.status == 200
         body = r.normal_body
         result = json.loads(body)
         self.assertEqual(_expected_result, result)
@@ -123,7 +122,7 @@
         headers = {}
 
         r = testApp.get('/uccs/zeroconf/api/4', headers=headers, expect_errors=True)
-        assert_equal(r.status, 200)
+        assert r.status == 200
         body = r.normal_body
         result = json.loads(body)
         self.assertEqual(_expected_result, result)
--- a/x2gobroker/tests/test_client_plain_base.py
+++ b/x2gobroker/tests/test_client_plain_base.py
@@ -25,7 +25,6 @@
 import x2gobroker.defaults
 import x2gobroker.client.plain
 
-from nose.tools import assert_equal, assert_true, assert_false
 
 class args():
     def __init__(self):
@@ -55,7 +54,7 @@
         tf.seek(0)
         x2gobroker.defaults.X2GOBROKER_CONFIG = tf.name
         r = x2gobroker.client.plain.X2GoBrokerClient().get(a)
-        assert_equal(r, None)
+        assert r is None
         tf.close()
         _config = """
 [broker_base]
@@ -68,7 +67,7 @@
         x2gobroker.defaults.X2GOBROKER_CONFIG = tf.name
         r = x2gobroker.client.plain.X2GoBrokerClient().get(a)
         lines = r.split('\n')
-        assert_equal(lines[1], "Access granted")
+        assert lines[1] == "Access granted"
         tf.close()
 
         x2gobroker.defaults.X2GOBROKER_CONFIG = _cf_bak
@@ -93,13 +92,13 @@
 
         r = x2gobroker.client.plain.X2GoBrokerClient().get(a)
 
-        assert_true('Access granted' in r)
-        assert_false('START_USER_SESSIONS' in r)
-        assert_false('END_USER_SESSIONS' in r)
-        assert_false('<BR>' in r)
-        assert_false('<br>' in r)
-        assert_false('<BR />' in r)
-        assert_false('<br />' in r)
+        assert 'Access granted' in r
+        assert not 'START_USER_SESSIONS' in r
+        assert not 'END_USER_SESSIONS' in r
+        assert not '<BR>' in r
+        assert not '<br>' in r
+        assert not '<BR />' in r
+        assert not '<br />' in r
 
         x2gobroker.defaults.X2GOBROKER_CONFIG = _cf_bak
 
--- a/x2gobroker/tests/test_web_plain_inifile.py
+++ b/x2gobroker/tests/test_web_plain_inifile.py
@@ -21,7 +21,6 @@
 import unittest
 #import tempfile
 #from paste.fixture import TestApp
-#from nose.tools import *
 import tornado.wsgi
 
 # Python X2GoBroker modules