leantesting 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/leantesting.gemspec +1 -1
- data/lib/BaseClass/APIRequest.rb +154 -151
- data/lib/BaseClass/Entity.rb +25 -24
- data/lib/BaseClass/EntityHandler.rb +151 -149
- data/lib/BaseClass/EntityList.rb +163 -161
- data/lib/Entity/Bug/Bug.rb +10 -8
- data/lib/Entity/Bug/BugAttachment.rb +7 -5
- data/lib/Entity/Bug/BugComment.rb +7 -5
- data/lib/Entity/Platform/PlatformBrowser.rb +9 -7
- data/lib/Entity/Platform/PlatformBrowserVersion.rb +7 -5
- data/lib/Entity/Platform/PlatformDevice.rb +7 -5
- data/lib/Entity/Platform/PlatformOS.rb +9 -7
- data/lib/Entity/Platform/PlatformOSVersion.rb +7 -5
- data/lib/Entity/Platform/PlatformType.rb +9 -7
- data/lib/Entity/Project/Project.rb +24 -22
- data/lib/Entity/Project/ProjectBugScheme.rb +7 -5
- data/lib/Entity/Project/ProjectSection.rb +7 -5
- data/lib/Entity/Project/ProjectUser.rb +7 -5
- data/lib/Entity/Project/ProjectVersion.rb +7 -5
- data/lib/Entity/User/UserOrganization.rb +7 -5
- data/lib/Exception/BaseException/SDKException.rb +15 -13
- data/lib/Exception/SDKBadJSONResponseException.rb +13 -11
- data/lib/Exception/SDKDuplicateRequestException.rb +15 -13
- data/lib/Exception/SDKErrorResponseException.rb +12 -10
- data/lib/Exception/SDKIncompleteRequestException.rb +15 -13
- data/lib/Exception/SDKInvalidArgException.rb +13 -11
- data/lib/Exception/SDKMissingArgException.rb +13 -11
- data/lib/Exception/SDKUnexpectedResponseException.rb +13 -11
- data/lib/Exception/SDKUnsupportedRequestException.rb +15 -13
- data/lib/Handler/Attachment/AttachmentsHandler.rb +14 -12
- data/lib/Handler/Auth/OAuth2Handler.rb +102 -100
- data/lib/Handler/Bug/BugAttachmentsHandler.rb +44 -42
- data/lib/Handler/Bug/BugCommentsHandler.rb +16 -14
- data/lib/Handler/Bug/BugsHandler.rb +53 -51
- data/lib/Handler/Platform/PlatformBrowserVersionsHandler.rb +16 -14
- data/lib/Handler/Platform/PlatformBrowsersHandler.rb +18 -16
- data/lib/Handler/Platform/PlatformDevicesHandler.rb +9 -7
- data/lib/Handler/Platform/PlatformHandler.rb +20 -18
- data/lib/Handler/Platform/PlatformOSHandler.rb +18 -16
- data/lib/Handler/Platform/PlatformOSVersionsHandler.rb +16 -14
- data/lib/Handler/Platform/PlatformTypeDevicesHandler.rb +16 -14
- data/lib/Handler/Platform/PlatformTypesHandler.rb +17 -15
- data/lib/Handler/Project/ProjectBugReproducibilitySchemeHandler.rb +16 -14
- data/lib/Handler/Project/ProjectBugSeveritySchemeHandler.rb +16 -14
- data/lib/Handler/Project/ProjectBugStatusSchemeHandler.rb +16 -14
- data/lib/Handler/Project/ProjectBugTypeSchemeHandler.rb +16 -14
- data/lib/Handler/Project/ProjectBugsHandler.rb +55 -53
- data/lib/Handler/Project/ProjectSectionsHandler.rb +30 -28
- data/lib/Handler/Project/ProjectUsersHandler.rb +16 -14
- data/lib/Handler/Project/ProjectVersionsHandler.rb +30 -28
- data/lib/Handler/Project/ProjectsHandler.rb +34 -32
- data/lib/Handler/User/UserHandler.rb +12 -10
- data/lib/Handler/User/UserOrganizationsHandler.rb +12 -10
- data/tests/APIRequestTest.rb +33 -33
- data/tests/BaseClassesTest.rb +28 -28
- data/tests/ClientTest.rb +7 -7
- data/tests/EntitiesTest.rb +31 -31
- data/tests/EntityListTest.rb +13 -13
- data/tests/ExceptionsTest.rb +15 -15
- data/tests/HandlersRequestsTest.rb +37 -37
- data/tests/MockRequestsTest.rb +48 -48
- data/tests/OAuth2HandlerTest.rb +19 -19
- metadata +2 -1
data/tests/MockRequestsTest.rb
CHANGED
@@ -77,7 +77,7 @@ class MockRequestsTest < MiniTest::Test
|
|
77
77
|
end
|
78
78
|
def test_GetUserOrganizations
|
79
79
|
colName = 'organizations'
|
80
|
-
retClass = UserOrganization
|
80
|
+
retClass = LeanTesting::UserOrganization
|
81
81
|
resp = rcol(colName, ['_id', 'name', 'alias', 'url', 'logo'])
|
82
82
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
83
83
|
|
@@ -99,7 +99,7 @@ class MockRequestsTest < MiniTest::Test
|
|
99
99
|
# PROJECT
|
100
100
|
def test_ListAllProjects
|
101
101
|
colName = 'projects'
|
102
|
-
retClass = Project
|
102
|
+
retClass = LeanTesting::Project
|
103
103
|
resp = rcol(colName, ['_id', 'name', '_owner_id', '_organization_id', '_is_archived', 'created_at'])
|
104
104
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
105
105
|
|
@@ -112,7 +112,7 @@ class MockRequestsTest < MiniTest::Test
|
|
112
112
|
assert_equal resp['meta']['pagination']['count'], col.count
|
113
113
|
end
|
114
114
|
def test_CreateNewProject
|
115
|
-
retClass = Project
|
115
|
+
retClass = LeanTesting::Project
|
116
116
|
resp = robj(['_id', 'name', '_owner_id', '_organization_id', '_is_archived', 'created_at'])
|
117
117
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
118
118
|
|
@@ -124,7 +124,7 @@ class MockRequestsTest < MiniTest::Test
|
|
124
124
|
assert_instance_of retClass, obj
|
125
125
|
end
|
126
126
|
def test_RetrieveExistingProject
|
127
|
-
retClass = Project
|
127
|
+
retClass = LeanTesting::Project
|
128
128
|
resp = robj(['_id', 'name', '_owner_id', '_organization_id', '_is_archived', 'created_at'])
|
129
129
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
130
130
|
|
@@ -137,11 +137,11 @@ class MockRequestsTest < MiniTest::Test
|
|
137
137
|
|
138
138
|
def test_ListProjectSections
|
139
139
|
colName = 'sections'
|
140
|
-
retClass = ProjectSection
|
140
|
+
retClass = LeanTesting::ProjectSection
|
141
141
|
resp = rcol(colName, ['_id', 'name', '_project_id'])
|
142
142
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
143
143
|
|
144
|
-
col = Project.new(@client, {'id'=> 0}).sections.all
|
144
|
+
col = LeanTesting::Project.new(@client, {'id'=> 0}).sections.all
|
145
145
|
|
146
146
|
assert_equal resp[colName], col.toArray
|
147
147
|
assert_instance_of retClass, col.collection[0]
|
@@ -150,11 +150,11 @@ class MockRequestsTest < MiniTest::Test
|
|
150
150
|
assert_equal resp['meta']['pagination']['count'], col.count
|
151
151
|
end
|
152
152
|
def test_AddProjectSection
|
153
|
-
retClass = ProjectSection
|
153
|
+
retClass = LeanTesting::ProjectSection
|
154
154
|
resp = robj(['_id', 'name', '_project_id'])
|
155
155
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
156
156
|
|
157
|
-
obj = Project.new(@client, {'id'=> 0}).sections.create({
|
157
|
+
obj = LeanTesting::Project.new(@client, {'id'=> 0}).sections.create({
|
158
158
|
'name'=> ''
|
159
159
|
})
|
160
160
|
|
@@ -165,11 +165,11 @@ class MockRequestsTest < MiniTest::Test
|
|
165
165
|
|
166
166
|
def test_ListProjectVersions
|
167
167
|
colName = 'versions'
|
168
|
-
retClass = ProjectVersion
|
168
|
+
retClass = LeanTesting::ProjectVersion
|
169
169
|
resp = rcol(colName, ['_id', 'number', '_project_id'])
|
170
170
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
171
171
|
|
172
|
-
col = Project.new(@client, {'id'=> 0}).versions.all
|
172
|
+
col = LeanTesting::Project.new(@client, {'id'=> 0}).versions.all
|
173
173
|
|
174
174
|
assert_equal resp[colName], col.toArray
|
175
175
|
assert_instance_of retClass, col.collection[0]
|
@@ -178,11 +178,11 @@ class MockRequestsTest < MiniTest::Test
|
|
178
178
|
assert_equal resp['meta']['pagination']['count'], col.count
|
179
179
|
end
|
180
180
|
def test_AddProjectVersion
|
181
|
-
retClass = ProjectVersion
|
181
|
+
retClass = LeanTesting::ProjectVersion
|
182
182
|
resp = robj(['_id', 'number', '_project_id'])
|
183
183
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
184
184
|
|
185
|
-
obj = Project.new(@client, {'id'=> 0}).versions.create({
|
185
|
+
obj = LeanTesting::Project.new(@client, {'id'=> 0}).versions.create({
|
186
186
|
'number'=> ''
|
187
187
|
})
|
188
188
|
|
@@ -193,11 +193,11 @@ class MockRequestsTest < MiniTest::Test
|
|
193
193
|
|
194
194
|
def test_ListProjectUsers
|
195
195
|
colName = 'users'
|
196
|
-
retClass = ProjectUser
|
196
|
+
retClass = LeanTesting::ProjectUser
|
197
197
|
resp = rcol(colName, ['_id', 'username', 'first_name', 'last_name', 'avatar', 'email', 'created_at'])
|
198
198
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
199
199
|
|
200
|
-
col = Project.new(@client, {'id'=> 0}).users.all
|
200
|
+
col = LeanTesting::Project.new(@client, {'id'=> 0}).users.all
|
201
201
|
|
202
202
|
assert_equal resp[colName], col.toArray
|
203
203
|
assert_instance_of retClass, col.collection[0]
|
@@ -209,11 +209,11 @@ class MockRequestsTest < MiniTest::Test
|
|
209
209
|
|
210
210
|
def test_ListProjectBugTypeScheme
|
211
211
|
colName = 'scheme'
|
212
|
-
retClass = ProjectBugScheme
|
212
|
+
retClass = LeanTesting::ProjectBugScheme
|
213
213
|
resp = rcol(colName, ['_id', 'name'])
|
214
214
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
215
215
|
|
216
|
-
col = Project.new(@client, {'id'=> 0}).bugTypeScheme.all
|
216
|
+
col = LeanTesting::Project.new(@client, {'id'=> 0}).bugTypeScheme.all
|
217
217
|
|
218
218
|
assert_equal resp[colName], col.toArray
|
219
219
|
assert_instance_of retClass, col.collection[0]
|
@@ -223,11 +223,11 @@ class MockRequestsTest < MiniTest::Test
|
|
223
223
|
end
|
224
224
|
def test_ListProjectBugStatusScheme
|
225
225
|
colName = 'scheme'
|
226
|
-
retClass = ProjectBugScheme
|
226
|
+
retClass = LeanTesting::ProjectBugScheme
|
227
227
|
resp = rcol(colName, ['_id', 'name'])
|
228
228
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
229
229
|
|
230
|
-
col = Project.new(@client, {'id'=> 0}).bugStatusScheme.all
|
230
|
+
col = LeanTesting::Project.new(@client, {'id'=> 0}).bugStatusScheme.all
|
231
231
|
|
232
232
|
assert_equal resp[colName], col.toArray
|
233
233
|
assert_instance_of retClass, col.collection[0]
|
@@ -237,11 +237,11 @@ class MockRequestsTest < MiniTest::Test
|
|
237
237
|
end
|
238
238
|
def test_ListProjectBugSeverityScheme
|
239
239
|
colName = 'scheme'
|
240
|
-
retClass = ProjectBugScheme
|
240
|
+
retClass = LeanTesting::ProjectBugScheme
|
241
241
|
resp = rcol(colName, ['_id', 'name'])
|
242
242
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
243
243
|
|
244
|
-
col = Project.new(@client, {'id'=> 0}).bugSeverityScheme.all
|
244
|
+
col = LeanTesting::Project.new(@client, {'id'=> 0}).bugSeverityScheme.all
|
245
245
|
|
246
246
|
assert_equal resp[colName], col.toArray
|
247
247
|
assert_instance_of retClass, col.collection[0]
|
@@ -251,11 +251,11 @@ class MockRequestsTest < MiniTest::Test
|
|
251
251
|
end
|
252
252
|
def test_ListProjectBugReproducibilityScheme
|
253
253
|
colName = 'scheme'
|
254
|
-
retClass = ProjectBugScheme
|
254
|
+
retClass = LeanTesting::ProjectBugScheme
|
255
255
|
resp = rcol(colName, ['_id', 'name'])
|
256
256
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
257
257
|
|
258
|
-
col = Project.new(@client, {'id'=> 0}).bugReproducibilityScheme.all
|
258
|
+
col = LeanTesting::Project.new(@client, {'id'=> 0}).bugReproducibilityScheme.all
|
259
259
|
|
260
260
|
assert_equal resp[colName], col.toArray
|
261
261
|
assert_instance_of retClass, col.collection[0]
|
@@ -275,13 +275,13 @@ class MockRequestsTest < MiniTest::Test
|
|
275
275
|
# BUG
|
276
276
|
def test_ListBugsInProject
|
277
277
|
colName = 'bugs'
|
278
|
-
retClass = Bug
|
278
|
+
retClass = LeanTesting::Bug
|
279
279
|
resp = rcol(colName, ['_id', 'title', '_status_id', '_severity_id', '_project_version_id',
|
280
280
|
'_project_section_id', '_type_id', '_reproducibility_id', '_assigned_user_id', 'description',
|
281
281
|
'expected_results'])
|
282
282
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
283
283
|
|
284
|
-
col = Project.new(@client, {'id'=> 0}).bugs.all
|
284
|
+
col = LeanTesting::Project.new(@client, {'id'=> 0}).bugs.all
|
285
285
|
|
286
286
|
assert_equal resp[colName], col.toArray
|
287
287
|
assert_instance_of retClass, col.collection[0]
|
@@ -290,13 +290,13 @@ class MockRequestsTest < MiniTest::Test
|
|
290
290
|
assert_equal resp['meta']['pagination']['count'], col.count
|
291
291
|
end
|
292
292
|
def test_CreateNewBug
|
293
|
-
retClass = Bug
|
293
|
+
retClass = LeanTesting::Bug
|
294
294
|
resp = robj(['_id', 'title', '_status_id', '_severity_id', '_project_version_id',
|
295
295
|
'_project_section_id', '_type_id', '_reproducibility_id', '_assigned_user_id', 'description',
|
296
296
|
'expected_results'])
|
297
297
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
298
298
|
|
299
|
-
obj = Project.new(@client, {'id'=> 0}).bugs.create({
|
299
|
+
obj = LeanTesting::Project.new(@client, {'id'=> 0}).bugs.create({
|
300
300
|
'title'=> '', 'status_id'=> 0, 'severity_id'=> 0, 'project_version_id'=> 0, 'project_section_id'=> 0,
|
301
301
|
'type_id'=> 0, 'reproducibility_id'=> 0, 'assigned_user_id'=> 0, 'description'=> '',
|
302
302
|
'expected_results'=> ''
|
@@ -306,7 +306,7 @@ class MockRequestsTest < MiniTest::Test
|
|
306
306
|
assert_instance_of retClass, obj
|
307
307
|
end
|
308
308
|
def test_RetrieveExistingBug
|
309
|
-
retClass = Bug
|
309
|
+
retClass = LeanTesting::Bug
|
310
310
|
resp = robj(['_id', 'title', '_status_id', '_severity_id', '_project_version_id',
|
311
311
|
'_project_section_id', '_type_id', '_reproducibility_id', '_assigned_user_id', 'description',
|
312
312
|
'expected_results'])
|
@@ -318,7 +318,7 @@ class MockRequestsTest < MiniTest::Test
|
|
318
318
|
assert_instance_of retClass, obj
|
319
319
|
end
|
320
320
|
def test_UpdateBug
|
321
|
-
retClass = Bug
|
321
|
+
retClass = LeanTesting::Bug
|
322
322
|
resp = robj(['_id', 'title', '_status_id', '_severity_id', '_project_version_id',
|
323
323
|
'_project_section_id', '_type_id', '_reproducibility_id', '_assigned_user_id', 'description',
|
324
324
|
'expected_results'])
|
@@ -350,11 +350,11 @@ class MockRequestsTest < MiniTest::Test
|
|
350
350
|
# BUG COMMENTS
|
351
351
|
def test_ListBugComments
|
352
352
|
colName = 'comments'
|
353
|
-
retClass = BugComment
|
353
|
+
retClass = LeanTesting::BugComment
|
354
354
|
resp = rcol(colName, ['_id', 'text', '_owner_id', 'created_at'])
|
355
355
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
356
356
|
|
357
|
-
col = Bug.new(@client, {'id'=> 0}).comments.all
|
357
|
+
col = LeanTesting::Bug.new(@client, {'id'=> 0}).comments.all
|
358
358
|
|
359
359
|
assert_equal resp[colName], col.toArray
|
360
360
|
assert_instance_of retClass, col.collection[0]
|
@@ -374,11 +374,11 @@ class MockRequestsTest < MiniTest::Test
|
|
374
374
|
# BUG ATTACHMENTS
|
375
375
|
def test_ListBugAttachments
|
376
376
|
colName = 'attachments'
|
377
|
-
retClass = BugAttachment
|
377
|
+
retClass = LeanTesting::BugAttachment
|
378
378
|
resp = rcol(colName, ['_id', '_owner_id', 'url', 'created_at'])
|
379
379
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
380
380
|
|
381
|
-
col = Bug.new(@client, {'id'=> 0}).attachments.all
|
381
|
+
col = LeanTesting::Bug.new(@client, {'id'=> 0}).attachments.all
|
382
382
|
|
383
383
|
assert_equal resp[colName], col.toArray
|
384
384
|
assert_instance_of retClass, col.collection[0]
|
@@ -387,18 +387,18 @@ class MockRequestsTest < MiniTest::Test
|
|
387
387
|
assert_equal resp['meta']['pagination']['count'], col.count
|
388
388
|
end
|
389
389
|
def test_CreateNewAttachment
|
390
|
-
retClass = BugAttachment
|
390
|
+
retClass = LeanTesting::BugAttachment
|
391
391
|
resp = robj(['_id', '_owner_id', 'url', 'created_at'])
|
392
392
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
393
393
|
|
394
394
|
_fp = File.expand_path(File.dirname(__FILE__)) + '/res/upload_sample.jpg'
|
395
|
-
obj = Bug.new(@client, {'id'=> 0}).attachments.upload(_fp)
|
395
|
+
obj = LeanTesting::Bug.new(@client, {'id'=> 0}).attachments.upload(_fp)
|
396
396
|
|
397
397
|
assert_equal resp, obj.data
|
398
398
|
assert_instance_of retClass, obj
|
399
399
|
end
|
400
400
|
def test_RetrieveExistingAttachment
|
401
|
-
retClass = BugAttachment
|
401
|
+
retClass = LeanTesting::BugAttachment
|
402
402
|
resp = robj(['_id', '_owner_id', 'url', 'created_at'])
|
403
403
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
404
404
|
|
@@ -426,7 +426,7 @@ class MockRequestsTest < MiniTest::Test
|
|
426
426
|
# PLATFORM
|
427
427
|
def test_ListPlatformTypes
|
428
428
|
colName = 'types'
|
429
|
-
retClass = PlatformType
|
429
|
+
retClass = LeanTesting::PlatformType
|
430
430
|
resp = rcol(colName, ['_id', 'name'])
|
431
431
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
432
432
|
|
@@ -439,7 +439,7 @@ class MockRequestsTest < MiniTest::Test
|
|
439
439
|
assert_equal resp['meta']['pagination']['count'], col.count
|
440
440
|
end
|
441
441
|
def test_RetrievePlatformType
|
442
|
-
retClass = PlatformType
|
442
|
+
retClass = LeanTesting::PlatformType
|
443
443
|
resp = robj(['_id', 'name'])
|
444
444
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
445
445
|
|
@@ -451,11 +451,11 @@ class MockRequestsTest < MiniTest::Test
|
|
451
451
|
|
452
452
|
def test_ListPlatformDevices
|
453
453
|
colName = 'devices'
|
454
|
-
retClass = PlatformDevice
|
454
|
+
retClass = LeanTesting::PlatformDevice
|
455
455
|
resp = rcol(colName, ['_id', 'name'])
|
456
456
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
457
457
|
|
458
|
-
col = PlatformType.new(@client, {'id'=> 0}).devices.all
|
458
|
+
col = LeanTesting::PlatformType.new(@client, {'id'=> 0}).devices.all
|
459
459
|
|
460
460
|
assert_equal resp[colName], col.toArray
|
461
461
|
assert_instance_of retClass, col.collection[0]
|
@@ -464,7 +464,7 @@ class MockRequestsTest < MiniTest::Test
|
|
464
464
|
assert_equal resp['meta']['pagination']['count'], col.count
|
465
465
|
end
|
466
466
|
def test_RetrievePlatformDevice
|
467
|
-
retClass = PlatformDevice
|
467
|
+
retClass = LeanTesting::PlatformDevice
|
468
468
|
resp = robj(['_id', 'name'])
|
469
469
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
470
470
|
|
@@ -476,7 +476,7 @@ class MockRequestsTest < MiniTest::Test
|
|
476
476
|
|
477
477
|
def test_ListOS
|
478
478
|
colName = 'os'
|
479
|
-
retClass = PlatformOS
|
479
|
+
retClass = LeanTesting::PlatformOS
|
480
480
|
resp = rcol(colName, ['_id', 'name'])
|
481
481
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
482
482
|
|
@@ -489,7 +489,7 @@ class MockRequestsTest < MiniTest::Test
|
|
489
489
|
assert_equal resp['meta']['pagination']['count'], col.count
|
490
490
|
end
|
491
491
|
def test_RetrieveOS
|
492
|
-
retClass = PlatformOS
|
492
|
+
retClass = LeanTesting::PlatformOS
|
493
493
|
resp = robj(['_id', 'name'])
|
494
494
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
495
495
|
|
@@ -500,11 +500,11 @@ class MockRequestsTest < MiniTest::Test
|
|
500
500
|
end
|
501
501
|
def test_ListOSVersions
|
502
502
|
colName = 'versions'
|
503
|
-
retClass = PlatformOSVersion
|
503
|
+
retClass = LeanTesting::PlatformOSVersion
|
504
504
|
resp = rcol(colName, ['_id', 'number'])
|
505
505
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
506
506
|
|
507
|
-
col = PlatformOS.new(@client, {'id'=> 0}).versions.all
|
507
|
+
col = LeanTesting::PlatformOS.new(@client, {'id'=> 0}).versions.all
|
508
508
|
|
509
509
|
assert_equal resp[colName], col.toArray
|
510
510
|
assert_instance_of retClass, col.collection[0]
|
@@ -515,7 +515,7 @@ class MockRequestsTest < MiniTest::Test
|
|
515
515
|
|
516
516
|
def test_ListBrowsers
|
517
517
|
colName = 'browsers'
|
518
|
-
retClass = PlatformBrowser
|
518
|
+
retClass = LeanTesting::PlatformBrowser
|
519
519
|
resp = rcol(colName, ['_id', 'name'])
|
520
520
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
521
521
|
|
@@ -528,7 +528,7 @@ class MockRequestsTest < MiniTest::Test
|
|
528
528
|
assert_equal resp['meta']['pagination']['count'], col.count
|
529
529
|
end
|
530
530
|
def test_RetrieveBrowser
|
531
|
-
retClass = PlatformBrowser
|
531
|
+
retClass = LeanTesting::PlatformBrowser
|
532
532
|
resp = robj(['_id', 'name'])
|
533
533
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
534
534
|
|
@@ -539,11 +539,11 @@ class MockRequestsTest < MiniTest::Test
|
|
539
539
|
end
|
540
540
|
def test_ListBrowserVersions
|
541
541
|
colName = 'versions'
|
542
|
-
retClass = PlatformBrowserVersion
|
542
|
+
retClass = LeanTesting::PlatformBrowserVersion
|
543
543
|
resp = rcol(colName, ['_id', 'name'])
|
544
544
|
@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}
|
545
545
|
|
546
|
-
col = PlatformBrowser.new(@client, {'id'=> 0}).versions.all
|
546
|
+
col = LeanTesting::PlatformBrowser.new(@client, {'id'=> 0}).versions.all
|
547
547
|
|
548
548
|
assert_equal resp[colName], col.toArray
|
549
549
|
assert_instance_of retClass, col.collection[0]
|
data/tests/OAuth2HandlerTest.rb
CHANGED
@@ -6,30 +6,30 @@ require_relative '../lib/leantesting'
|
|
6
6
|
class OAuth2HandlerTest < MiniTest::Test
|
7
7
|
|
8
8
|
def test_OAuth2HandlerDefined
|
9
|
-
OAuth2Handler
|
9
|
+
LeanTesting::OAuth2Handler
|
10
10
|
end
|
11
11
|
|
12
12
|
|
13
13
|
|
14
14
|
|
15
15
|
def test_OAuth2HandlerGenerateNonStrClientID
|
16
|
-
assert_raises SDKInvalidArgException do
|
17
|
-
OAuth2Handler.new(LeanTesting::Client.new).generateAuthLink(1, '', '')
|
16
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
17
|
+
LeanTesting::OAuth2Handler.new(LeanTesting::Client.new).generateAuthLink(1, '', '')
|
18
18
|
end
|
19
19
|
end
|
20
20
|
def test_OAuth2HandlerGenerateNonStrRedirectURI
|
21
|
-
assert_raises SDKInvalidArgException do
|
22
|
-
OAuth2Handler.new(LeanTesting::Client.new).generateAuthLink('', 1, '')
|
21
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
22
|
+
LeanTesting::OAuth2Handler.new(LeanTesting::Client.new).generateAuthLink('', 1, '')
|
23
23
|
end
|
24
24
|
end
|
25
25
|
def test_OAuth2HandlerGenerateNonStrScope
|
26
|
-
assert_raises SDKInvalidArgException do
|
27
|
-
OAuth2Handler.new(LeanTesting::Client.new).generateAuthLink('', '', 1)
|
26
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
27
|
+
LeanTesting::OAuth2Handler.new(LeanTesting::Client.new).generateAuthLink('', '', 1)
|
28
28
|
end
|
29
29
|
end
|
30
30
|
def test_OAuth2HandlerGenerateNonStrState
|
31
|
-
assert_raises SDKInvalidArgException do
|
32
|
-
OAuth2Handler.new(LeanTesting::Client.new).generateAuthLink('', '', '', 1)
|
31
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
32
|
+
LeanTesting::OAuth2Handler.new(LeanTesting::Client.new).generateAuthLink('', '', '', 1)
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
@@ -37,38 +37,38 @@ class OAuth2HandlerTest < MiniTest::Test
|
|
37
37
|
|
38
38
|
|
39
39
|
def test_OAuth2HandlerExchangeNonStrClientID
|
40
|
-
assert_raises SDKInvalidArgException do
|
40
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
41
41
|
client = LeanTesting::Client.new
|
42
42
|
client.debugReturn = '{}'
|
43
|
-
OAuth2Handler.new(client).exchangeAuthCode(1, '', '', '', '')
|
43
|
+
LeanTesting::OAuth2Handler.new(client).exchangeAuthCode(1, '', '', '', '')
|
44
44
|
end
|
45
45
|
end
|
46
46
|
def test_OAuth2HandlerExchangeNonStrClientSecret
|
47
|
-
assert_raises SDKInvalidArgException do
|
47
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
48
48
|
client = LeanTesting::Client.new
|
49
49
|
client.debugReturn = '{}'
|
50
|
-
OAuth2Handler.new(client).exchangeAuthCode('', 1, '', '', '')
|
50
|
+
LeanTesting::OAuth2Handler.new(client).exchangeAuthCode('', 1, '', '', '')
|
51
51
|
end
|
52
52
|
end
|
53
53
|
def test_OAuth2HandlerExchangeNonStrGrantType
|
54
|
-
assert_raises SDKInvalidArgException do
|
54
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
55
55
|
client = LeanTesting::Client.new
|
56
56
|
client.debugReturn = '{}'
|
57
|
-
OAuth2Handler.new(client).exchangeAuthCode('', '', 1, '', '')
|
57
|
+
LeanTesting::OAuth2Handler.new(client).exchangeAuthCode('', '', 1, '', '')
|
58
58
|
end
|
59
59
|
end
|
60
60
|
def test_OAuth2HandlerExchangeNonStrCode
|
61
|
-
assert_raises SDKInvalidArgException do
|
61
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
62
62
|
client = LeanTesting::Client.new
|
63
63
|
client.debugReturn = '{}'
|
64
|
-
OAuth2Handler.new(client).exchangeAuthCode('', '', '', 1, '')
|
64
|
+
LeanTesting::OAuth2Handler.new(client).exchangeAuthCode('', '', '', 1, '')
|
65
65
|
end
|
66
66
|
end
|
67
67
|
def test_OAuth2HandlerExchangeNonStrRedirectURI
|
68
|
-
assert_raises SDKInvalidArgException do
|
68
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
69
69
|
client = LeanTesting::Client.new
|
70
70
|
client.debugReturn = '{}'
|
71
|
-
OAuth2Handler.new(client).exchangeAuthCode('', '', '', '', 1)
|
71
|
+
LeanTesting::OAuth2Handler.new(client).exchangeAuthCode('', '', '', '', 1)
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: leantesting
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcel Bontaș
|
@@ -167,3 +167,4 @@ signing_key:
|
|
167
167
|
specification_version: 4
|
168
168
|
summary: Lean Testing Ruby SDK
|
169
169
|
test_files: []
|
170
|
+
has_rdoc:
|