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/BaseClassesTest.rb
CHANGED
@@ -7,24 +7,24 @@ class BaseClassesTest < MiniTest::Test
|
|
7
7
|
|
8
8
|
# Entity
|
9
9
|
def test_EntityDefined
|
10
|
-
Entity
|
10
|
+
LeanTesting::Entity
|
11
11
|
end
|
12
12
|
|
13
13
|
def test_EntityDataParsing
|
14
14
|
data = {'id' => 1}
|
15
|
-
entity = Entity.new(LeanTesting::Client.new, data)
|
15
|
+
entity = LeanTesting::Entity.new(LeanTesting::Client.new, data)
|
16
16
|
|
17
17
|
assert_equal entity.data, data
|
18
18
|
end
|
19
19
|
|
20
20
|
def test_EntityInstanceNonArrData
|
21
|
-
assert_raises SDKInvalidArgException do
|
22
|
-
Entity.new(LeanTesting::Client.new, '')
|
21
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
22
|
+
LeanTesting::Entity.new(LeanTesting::Client.new, '')
|
23
23
|
end
|
24
24
|
end
|
25
25
|
def test_EntityInstanceEmptyData
|
26
|
-
assert_raises SDKInvalidArgException do
|
27
|
-
Entity.new(LeanTesting::Client.new, {})
|
26
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
27
|
+
LeanTesting::Entity.new(LeanTesting::Client.new, {})
|
28
28
|
end
|
29
29
|
end
|
30
30
|
# END Entity
|
@@ -33,62 +33,62 @@ class BaseClassesTest < MiniTest::Test
|
|
33
33
|
|
34
34
|
# EntityHandler
|
35
35
|
def test_EntityHandlerDefined
|
36
|
-
EntityHandler
|
36
|
+
LeanTesting::EntityHandler
|
37
37
|
end
|
38
38
|
|
39
39
|
def test_EntityHandlerCreateNonArrFields
|
40
|
-
assert_raises SDKInvalidArgException do
|
41
|
-
EntityHandler.new(LeanTesting::Client.new).create('')
|
40
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
41
|
+
LeanTesting::EntityHandler.new(LeanTesting::Client.new).create('')
|
42
42
|
end
|
43
43
|
end
|
44
44
|
def test_EntityHandlerCreateEmptyFields
|
45
|
-
assert_raises SDKInvalidArgException do
|
46
|
-
EntityHandler.new(LeanTesting::Client.new).create({})
|
45
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
46
|
+
LeanTesting::EntityHandler.new(LeanTesting::Client.new).create({})
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
50
|
def test_EntityHandlerAllNonArrFilters
|
51
|
-
assert_raises SDKInvalidArgException do
|
52
|
-
EntityHandler.new(LeanTesting::Client.new).all('')
|
51
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
52
|
+
LeanTesting::EntityHandler.new(LeanTesting::Client.new).all('')
|
53
53
|
end
|
54
54
|
end
|
55
55
|
def test_EntityHandlerAllInvalidFilters
|
56
|
-
ex = assert_raises SDKInvalidArgException do
|
57
|
-
EntityHandler.new(LeanTesting::Client.new).all({'XXXfilterXXX' => 9999})
|
56
|
+
ex = assert_raises LeanTesting::SDKInvalidArgException do
|
57
|
+
LeanTesting::EntityHandler.new(LeanTesting::Client.new).all({'XXXfilterXXX' => 9999})
|
58
58
|
end
|
59
59
|
assert_match 'XXXfilterXXX', ex.message
|
60
60
|
end
|
61
61
|
def test_EntityHandlerAllSupportedFilters
|
62
|
-
EntityHandler.new(LeanTesting::Client.new).all({'include' => ''})
|
63
|
-
EntityHandler.new(LeanTesting::Client.new).all({'limit' => 10})
|
64
|
-
EntityHandler.new(LeanTesting::Client.new).all({'page' => 2})
|
62
|
+
LeanTesting::EntityHandler.new(LeanTesting::Client.new).all({'include' => ''})
|
63
|
+
LeanTesting::EntityHandler.new(LeanTesting::Client.new).all({'limit' => 10})
|
64
|
+
LeanTesting::EntityHandler.new(LeanTesting::Client.new).all({'page' => 2})
|
65
65
|
end
|
66
66
|
|
67
67
|
def test_EntityHandlerFindNonIntID
|
68
|
-
assert_raises SDKInvalidArgException do
|
69
|
-
EntityHandler.new(LeanTesting::Client.new).find('')
|
68
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
69
|
+
LeanTesting::EntityHandler.new(LeanTesting::Client.new).find('')
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
73
|
def test_EntityHandlerDeleteNonIntID
|
74
|
-
assert_raises SDKInvalidArgException do
|
75
|
-
EntityHandler.new(LeanTesting::Client.new).delete('')
|
74
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
75
|
+
LeanTesting::EntityHandler.new(LeanTesting::Client.new).delete('')
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
79
|
def test_EntityHandlerUpdateNonIntID
|
80
|
-
assert_raises SDKInvalidArgException do
|
81
|
-
EntityHandler.new(LeanTesting::Client.new).update('', {'x' => 5})
|
80
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
81
|
+
LeanTesting::EntityHandler.new(LeanTesting::Client.new).update('', {'x' => 5})
|
82
82
|
end
|
83
83
|
end
|
84
84
|
def test_EntityHandlerUpdateNonArrFields
|
85
|
-
assert_raises SDKInvalidArgException do
|
86
|
-
EntityHandler.new(LeanTesting::Client.new).update(5, '')
|
85
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
86
|
+
LeanTesting::EntityHandler.new(LeanTesting::Client.new).update(5, '')
|
87
87
|
end
|
88
88
|
end
|
89
89
|
def test_EntityHandlerUpdateEmptyFields
|
90
|
-
assert_raises SDKInvalidArgException do
|
91
|
-
EntityHandler.new(LeanTesting::Client.new).update(5, {})
|
90
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
91
|
+
LeanTesting::EntityHandler.new(LeanTesting::Client.new).update(5, {})
|
92
92
|
end
|
93
93
|
end
|
94
94
|
# END EntityHandler
|
data/tests/ClientTest.rb
CHANGED
@@ -13,22 +13,22 @@ class BaseClassesTest < MiniTest::Test
|
|
13
13
|
|
14
14
|
|
15
15
|
def test_ClientHasAuthObj
|
16
|
-
assert_instance_of OAuth2Handler, LeanTesting::Client.new.auth
|
16
|
+
assert_instance_of LeanTesting::OAuth2Handler, LeanTesting::Client.new.auth
|
17
17
|
end
|
18
18
|
def test_ClientHasUserObj
|
19
|
-
assert_instance_of UserHandler, LeanTesting::Client.new.user
|
19
|
+
assert_instance_of LeanTesting::UserHandler, LeanTesting::Client.new.user
|
20
20
|
end
|
21
21
|
def test_ClientHasProjectsObj
|
22
|
-
assert_instance_of ProjectsHandler, LeanTesting::Client.new.projects
|
22
|
+
assert_instance_of LeanTesting::ProjectsHandler, LeanTesting::Client.new.projects
|
23
23
|
end
|
24
24
|
def test_ClientHasBugsObj
|
25
|
-
assert_instance_of BugsHandler, LeanTesting::Client.new.bugs
|
25
|
+
assert_instance_of LeanTesting::BugsHandler, LeanTesting::Client.new.bugs
|
26
26
|
end
|
27
27
|
def test_ClientHasAttachmentsObj
|
28
|
-
assert_instance_of AttachmentsHandler, LeanTesting::Client.new.attachments
|
28
|
+
assert_instance_of LeanTesting::AttachmentsHandler, LeanTesting::Client.new.attachments
|
29
29
|
end
|
30
30
|
def test_ClientHasPlatformObj
|
31
|
-
assert_instance_of PlatformHandler, LeanTesting::Client.new.platform
|
31
|
+
assert_instance_of LeanTesting::PlatformHandler, LeanTesting::Client.new.platform
|
32
32
|
end
|
33
33
|
|
34
34
|
|
@@ -44,7 +44,7 @@ class BaseClassesTest < MiniTest::Test
|
|
44
44
|
assert_equal client.getCurrentToken, tokenName
|
45
45
|
end
|
46
46
|
def test_TokenParseNonStr
|
47
|
-
assert_raises SDKInvalidArgException do
|
47
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
48
48
|
LeanTesting::Client.new.attachToken(7182381)
|
49
49
|
end
|
50
50
|
end
|
data/tests/EntitiesTest.rb
CHANGED
@@ -7,41 +7,41 @@ class EntitiesTest < MiniTest::Test
|
|
7
7
|
|
8
8
|
def setup
|
9
9
|
@entityColllection = [
|
10
|
-
[Bug, {
|
11
|
-
'comments' => BugCommentsHandler,
|
12
|
-
'attachments' => BugAttachmentsHandler
|
10
|
+
[LeanTesting::Bug, {
|
11
|
+
'comments' => LeanTesting::BugCommentsHandler,
|
12
|
+
'attachments' => LeanTesting::BugAttachmentsHandler
|
13
13
|
}],
|
14
|
-
[BugAttachment],
|
15
|
-
[BugComment],
|
16
|
-
[PlatformBrowser, {
|
17
|
-
'versions' => PlatformBrowserVersionsHandler
|
14
|
+
[LeanTesting::BugAttachment],
|
15
|
+
[LeanTesting::BugComment],
|
16
|
+
[LeanTesting::PlatformBrowser, {
|
17
|
+
'versions' => LeanTesting::PlatformBrowserVersionsHandler
|
18
18
|
}],
|
19
|
-
[PlatformBrowserVersion],
|
20
|
-
[PlatformDevice],
|
21
|
-
[PlatformOS, {
|
22
|
-
'versions' => PlatformOSVersionsHandler
|
19
|
+
[LeanTesting::PlatformBrowserVersion],
|
20
|
+
[LeanTesting::PlatformDevice],
|
21
|
+
[LeanTesting::PlatformOS, {
|
22
|
+
'versions' => LeanTesting::PlatformOSVersionsHandler
|
23
23
|
}],
|
24
|
-
[PlatformOSVersion],
|
25
|
-
[PlatformType, {
|
26
|
-
'devices' => PlatformTypeDevicesHandler
|
24
|
+
[LeanTesting::PlatformOSVersion],
|
25
|
+
[LeanTesting::PlatformType, {
|
26
|
+
'devices' => LeanTesting::PlatformTypeDevicesHandler
|
27
27
|
}],
|
28
|
-
[Project, {
|
29
|
-
'sections' => ProjectSectionsHandler,
|
30
|
-
'versions' => ProjectVersionsHandler,
|
31
|
-
'users' => ProjectUsersHandler,
|
28
|
+
[LeanTesting::Project, {
|
29
|
+
'sections' => LeanTesting::ProjectSectionsHandler,
|
30
|
+
'versions' => LeanTesting::ProjectVersionsHandler,
|
31
|
+
'users' => LeanTesting::ProjectUsersHandler,
|
32
32
|
|
33
|
-
'bugTypeScheme' => ProjectBugTypeSchemeHandler,
|
34
|
-
'bugStatusScheme' => ProjectBugStatusSchemeHandler,
|
35
|
-
'bugSeverityScheme' => ProjectBugSeveritySchemeHandler,
|
36
|
-
'bugReproducibilityScheme' => ProjectBugReproducibilitySchemeHandler,
|
33
|
+
'bugTypeScheme' => LeanTesting::ProjectBugTypeSchemeHandler,
|
34
|
+
'bugStatusScheme' => LeanTesting::ProjectBugStatusSchemeHandler,
|
35
|
+
'bugSeverityScheme' => LeanTesting::ProjectBugSeveritySchemeHandler,
|
36
|
+
'bugReproducibilityScheme' => LeanTesting::ProjectBugReproducibilitySchemeHandler,
|
37
37
|
|
38
|
-
'bugs' => ProjectBugsHandler
|
38
|
+
'bugs' => LeanTesting::ProjectBugsHandler
|
39
39
|
}],
|
40
|
-
[ProjectBugScheme],
|
41
|
-
[ProjectSection],
|
42
|
-
[ProjectUser],
|
43
|
-
[ProjectVersion],
|
44
|
-
[UserOrganization]
|
40
|
+
[LeanTesting::ProjectBugScheme],
|
41
|
+
[LeanTesting::ProjectSection],
|
42
|
+
[LeanTesting::ProjectUser],
|
43
|
+
[LeanTesting::ProjectVersion],
|
44
|
+
[LeanTesting::UserOrganization]
|
45
45
|
]
|
46
46
|
end
|
47
47
|
|
@@ -52,7 +52,7 @@ class EntitiesTest < MiniTest::Test
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def test_EntitiesCorrectParent
|
55
|
-
@entityColllection.each { |e| assert_kind_of Entity, e[0].new(LeanTesting::Client.new, {'id'=> 1}) }
|
55
|
+
@entityColllection.each { |e| assert_kind_of LeanTesting::Entity, e[0].new(LeanTesting::Client.new, {'id'=> 1}) }
|
56
56
|
end
|
57
57
|
|
58
58
|
def test_EntitiesDataParsing
|
@@ -67,14 +67,14 @@ class EntitiesTest < MiniTest::Test
|
|
67
67
|
|
68
68
|
def test_EntitiesInstanceNonArrData
|
69
69
|
@entityColllection.each do |e|
|
70
|
-
assert_raises SDKInvalidArgException do
|
70
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
71
71
|
e[0].new(LeanTesting::Client.new, '')
|
72
72
|
end
|
73
73
|
end
|
74
74
|
end
|
75
75
|
def test_EntitiesInstanceEmptyData
|
76
76
|
@entityColllection.each do |e|
|
77
|
-
assert_raises SDKInvalidArgException do
|
77
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
78
78
|
e[0].new(LeanTesting::Client.new, {})
|
79
79
|
end
|
80
80
|
end
|
data/tests/EntityListTest.rb
CHANGED
@@ -6,44 +6,44 @@ require_relative '../lib/leantesting'
|
|
6
6
|
class EntityListTest < MiniTest::Test
|
7
7
|
|
8
8
|
def test_EntityListDefined
|
9
|
-
EntityList
|
9
|
+
LeanTesting::EntityList
|
10
10
|
end
|
11
11
|
|
12
12
|
|
13
13
|
|
14
14
|
def test_EntityListBadRespMissingMeta
|
15
|
-
req = APIRequest.new(LeanTesting::Client.new, '/any/method', 'GET')
|
15
|
+
req = LeanTesting::APIRequest.new(LeanTesting::Client.new, '/any/method', 'GET')
|
16
16
|
req.expects(:call).returns({'data'=> '{"x": []}', 'status'=> 200})
|
17
17
|
|
18
|
-
ex = assert_raises SDKUnexpectedResponseException do
|
19
|
-
EntityList.new(LeanTesting::Client.new, req, 'X')
|
18
|
+
ex = assert_raises LeanTesting::SDKUnexpectedResponseException do
|
19
|
+
LeanTesting::EntityList.new(LeanTesting::Client.new, req, 'X')
|
20
20
|
end
|
21
21
|
assert_match 'meta', ex.message
|
22
22
|
end
|
23
23
|
def test_EntityListBadRespMissingMetaPagination
|
24
|
-
req = APIRequest.new(LeanTesting::Client.new, '/any/method', 'GET')
|
24
|
+
req = LeanTesting::APIRequest.new(LeanTesting::Client.new, '/any/method', 'GET')
|
25
25
|
req.expects(:call).returns({'data'=> '{"x": [], "meta": {}}', 'status'=> 200})
|
26
26
|
|
27
|
-
ex = assert_raises SDKUnexpectedResponseException do
|
28
|
-
EntityList.new(LeanTesting::Client.new, req, 'X')
|
27
|
+
ex = assert_raises LeanTesting::SDKUnexpectedResponseException do
|
28
|
+
LeanTesting::EntityList.new(LeanTesting::Client.new, req, 'X')
|
29
29
|
end
|
30
30
|
assert_match 'pagination', ex.message
|
31
31
|
end
|
32
32
|
def test_EntityListBadRespMissingCollection
|
33
|
-
req = APIRequest.new(LeanTesting::Client.new, '/any/method', 'GET')
|
33
|
+
req = LeanTesting::APIRequest.new(LeanTesting::Client.new, '/any/method', 'GET')
|
34
34
|
req.expects(:call).returns({'data'=> '{"meta": {"pagination": {}}}', 'status'=> 200})
|
35
35
|
|
36
|
-
ex = assert_raises SDKUnexpectedResponseException do
|
37
|
-
EntityList.new(LeanTesting::Client.new, req, 'X')
|
36
|
+
ex = assert_raises LeanTesting::SDKUnexpectedResponseException do
|
37
|
+
LeanTesting::EntityList.new(LeanTesting::Client.new, req, 'X')
|
38
38
|
end
|
39
39
|
assert_match 'collection', ex.message
|
40
40
|
end
|
41
41
|
def test_EntityListBadRespMultipleCollections
|
42
|
-
req = APIRequest.new(LeanTesting::Client.new, '/any/method', 'GET')
|
42
|
+
req = LeanTesting::APIRequest.new(LeanTesting::Client.new, '/any/method', 'GET')
|
43
43
|
req.expects(:call).returns({'data'=> '{"xxy": [], "yyx": [], "meta": {"pagination": {}}}', 'status'=> 200})
|
44
44
|
|
45
|
-
ex = assert_raises SDKUnexpectedResponseException do
|
46
|
-
EntityList.new(LeanTesting::Client.new, req, 'X')
|
45
|
+
ex = assert_raises LeanTesting::SDKUnexpectedResponseException do
|
46
|
+
LeanTesting::EntityList.new(LeanTesting::Client.new, req, 'X')
|
47
47
|
end
|
48
48
|
assert_match 'multiple', ex.message
|
49
49
|
end
|
data/tests/ExceptionsTest.rb
CHANGED
@@ -7,15 +7,15 @@ class ExceptionsTest < MiniTest::Test
|
|
7
7
|
|
8
8
|
def setup
|
9
9
|
@exceptionCollection = [
|
10
|
-
[SDKException],
|
11
|
-
[SDKBadJSONResponseException],
|
12
|
-
[SDKDuplicateRequestException],
|
13
|
-
[SDKErrorResponseException],
|
14
|
-
[SDKIncompleteRequestException],
|
15
|
-
[SDKInvalidArgException],
|
16
|
-
[SDKMissingArgException],
|
17
|
-
[SDKUnexpectedResponseException],
|
18
|
-
[SDKUnsupportedRequestException]
|
10
|
+
[LeanTesting::SDKException],
|
11
|
+
[LeanTesting::SDKBadJSONResponseException],
|
12
|
+
[LeanTesting::SDKDuplicateRequestException],
|
13
|
+
[LeanTesting::SDKErrorResponseException],
|
14
|
+
[LeanTesting::SDKIncompleteRequestException],
|
15
|
+
[LeanTesting::SDKInvalidArgException],
|
16
|
+
[LeanTesting::SDKMissingArgException],
|
17
|
+
[LeanTesting::SDKUnexpectedResponseException],
|
18
|
+
[LeanTesting::SDKUnsupportedRequestException]
|
19
19
|
]
|
20
20
|
end
|
21
21
|
|
@@ -48,20 +48,20 @@ class ExceptionsTest < MiniTest::Test
|
|
48
48
|
|
49
49
|
# RAISE WITH ARR (when supported)
|
50
50
|
def test_DuplicateRequestRaiseWithArr
|
51
|
-
ex = assert_raises SDKDuplicateRequestException do
|
52
|
-
raise SDKDuplicateRequestException, ['xx', 'yy', 'zz']
|
51
|
+
ex = assert_raises LeanTesting::SDKDuplicateRequestException do
|
52
|
+
raise LeanTesting::SDKDuplicateRequestException, ['xx', 'yy', 'zz']
|
53
53
|
end
|
54
54
|
assert_match 'Duplicate', ex.message
|
55
55
|
end
|
56
56
|
def test_IncompleteRequestRaiseWithArr
|
57
|
-
ex = assert_raises SDKIncompleteRequestException do
|
58
|
-
raise SDKIncompleteRequestException, ['xx', 'yy', 'zz']
|
57
|
+
ex = assert_raises LeanTesting::SDKIncompleteRequestException do
|
58
|
+
raise LeanTesting::SDKIncompleteRequestException, ['xx', 'yy', 'zz']
|
59
59
|
end
|
60
60
|
assert_match 'Incomplete', ex.message
|
61
61
|
end
|
62
62
|
def test_UnsupportedRequestRaiseWithArr
|
63
|
-
ex = assert_raises SDKUnsupportedRequestException do
|
64
|
-
raise SDKUnsupportedRequestException, ['xx', 'yy', 'zz']
|
63
|
+
ex = assert_raises LeanTesting::SDKUnsupportedRequestException do
|
64
|
+
raise LeanTesting::SDKUnsupportedRequestException, ['xx', 'yy', 'zz']
|
65
65
|
end
|
66
66
|
assert_match 'Unsupported', ex.message
|
67
67
|
end
|
@@ -7,29 +7,29 @@ class HandlersTest < MiniTest::Test
|
|
7
7
|
|
8
8
|
def setup
|
9
9
|
@handlerCollection = [
|
10
|
-
[AttachmentsHandler],
|
11
|
-
[BugAttachmentsHandler, 'requiresIDInConstructor'],
|
12
|
-
[BugCommentsHandler, 'requiresIDInConstructor'],
|
13
|
-
[BugsHandler],
|
14
|
-
[PlatformBrowsersHandler],
|
15
|
-
[PlatformBrowserVersionsHandler, 'requiresIDInConstructor'],
|
16
|
-
[PlatformDevicesHandler],
|
17
|
-
[PlatformHandler],
|
18
|
-
[PlatformOSHandler],
|
19
|
-
[PlatformOSVersionsHandler, 'requiresIDInConstructor'],
|
20
|
-
[PlatformTypeDevicesHandler, 'requiresIDInConstructor'],
|
21
|
-
[PlatformTypesHandler],
|
22
|
-
[ProjectBugReproducibilitySchemeHandler, 'requiresIDInConstructor'],
|
23
|
-
[ProjectBugSeveritySchemeHandler, 'requiresIDInConstructor'],
|
24
|
-
[ProjectBugsHandler, 'requiresIDInConstructor'],
|
25
|
-
[ProjectBugStatusSchemeHandler, 'requiresIDInConstructor'],
|
26
|
-
[ProjectBugTypeSchemeHandler, 'requiresIDInConstructor'],
|
27
|
-
[ProjectSectionsHandler, 'requiresIDInConstructor'],
|
28
|
-
[ProjectsHandler],
|
29
|
-
[ProjectUsersHandler, 'requiresIDInConstructor'],
|
30
|
-
[ProjectVersionsHandler, 'requiresIDInConstructor'],
|
31
|
-
[UserHandler],
|
32
|
-
[UserOrganizationsHandler]
|
10
|
+
[LeanTesting::AttachmentsHandler],
|
11
|
+
[LeanTesting::BugAttachmentsHandler, 'requiresIDInConstructor'],
|
12
|
+
[LeanTesting::BugCommentsHandler, 'requiresIDInConstructor'],
|
13
|
+
[LeanTesting::BugsHandler],
|
14
|
+
[LeanTesting::PlatformBrowsersHandler],
|
15
|
+
[LeanTesting::PlatformBrowserVersionsHandler, 'requiresIDInConstructor'],
|
16
|
+
[LeanTesting::PlatformDevicesHandler],
|
17
|
+
[LeanTesting::PlatformHandler],
|
18
|
+
[LeanTesting::PlatformOSHandler],
|
19
|
+
[LeanTesting::PlatformOSVersionsHandler, 'requiresIDInConstructor'],
|
20
|
+
[LeanTesting::PlatformTypeDevicesHandler, 'requiresIDInConstructor'],
|
21
|
+
[LeanTesting::PlatformTypesHandler],
|
22
|
+
[LeanTesting::ProjectBugReproducibilitySchemeHandler, 'requiresIDInConstructor'],
|
23
|
+
[LeanTesting::ProjectBugSeveritySchemeHandler, 'requiresIDInConstructor'],
|
24
|
+
[LeanTesting::ProjectBugsHandler, 'requiresIDInConstructor'],
|
25
|
+
[LeanTesting::ProjectBugStatusSchemeHandler, 'requiresIDInConstructor'],
|
26
|
+
[LeanTesting::ProjectBugTypeSchemeHandler, 'requiresIDInConstructor'],
|
27
|
+
[LeanTesting::ProjectSectionsHandler, 'requiresIDInConstructor'],
|
28
|
+
[LeanTesting::ProjectsHandler],
|
29
|
+
[LeanTesting::ProjectUsersHandler, 'requiresIDInConstructor'],
|
30
|
+
[LeanTesting::ProjectVersionsHandler, 'requiresIDInConstructor'],
|
31
|
+
[LeanTesting::UserHandler],
|
32
|
+
[LeanTesting::UserOrganizationsHandler]
|
33
33
|
]
|
34
34
|
end
|
35
35
|
|
@@ -50,7 +50,7 @@ class HandlersTest < MiniTest::Test
|
|
50
50
|
else
|
51
51
|
inst = e[0].new(LeanTesting::Client.new)
|
52
52
|
end
|
53
|
-
assert_raises SDKInvalidArgException do
|
53
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
54
54
|
inst.create('')
|
55
55
|
end
|
56
56
|
end
|
@@ -62,7 +62,7 @@ class HandlersTest < MiniTest::Test
|
|
62
62
|
else
|
63
63
|
inst = e[0].new(LeanTesting::Client.new)
|
64
64
|
end
|
65
|
-
assert_raises SDKInvalidArgException do
|
65
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
66
66
|
inst.create({})
|
67
67
|
end
|
68
68
|
end
|
@@ -79,7 +79,7 @@ class HandlersTest < MiniTest::Test
|
|
79
79
|
else
|
80
80
|
inst = e[0].new(LeanTesting::Client.new)
|
81
81
|
end
|
82
|
-
assert_raises SDKInvalidArgException do
|
82
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
83
83
|
inst.all('')
|
84
84
|
end
|
85
85
|
end
|
@@ -91,7 +91,7 @@ class HandlersTest < MiniTest::Test
|
|
91
91
|
else
|
92
92
|
inst = e[0].new(LeanTesting::Client.new)
|
93
93
|
end
|
94
|
-
assert_raises SDKInvalidArgException do
|
94
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
95
95
|
inst.all({'XXXfilterXXX'=> 9999})
|
96
96
|
end
|
97
97
|
end
|
@@ -127,7 +127,7 @@ class HandlersTest < MiniTest::Test
|
|
127
127
|
else
|
128
128
|
inst = e[0].new(LeanTesting::Client.new)
|
129
129
|
end
|
130
|
-
assert_raises SDKInvalidArgException do
|
130
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
131
131
|
inst.find('')
|
132
132
|
end
|
133
133
|
end
|
@@ -143,7 +143,7 @@ class HandlersTest < MiniTest::Test
|
|
143
143
|
else
|
144
144
|
inst = e[0].new(LeanTesting::Client.new)
|
145
145
|
end
|
146
|
-
assert_raises SDKInvalidArgException do
|
146
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
147
147
|
inst.delete('')
|
148
148
|
end
|
149
149
|
end
|
@@ -160,7 +160,7 @@ class HandlersTest < MiniTest::Test
|
|
160
160
|
else
|
161
161
|
inst = e[0].new(LeanTesting::Client.new)
|
162
162
|
end
|
163
|
-
assert_raises SDKInvalidArgException do
|
163
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
164
164
|
inst.update('', {'x'=> 5})
|
165
165
|
end
|
166
166
|
end
|
@@ -172,7 +172,7 @@ class HandlersTest < MiniTest::Test
|
|
172
172
|
else
|
173
173
|
inst = e[0].new(LeanTesting::Client.new)
|
174
174
|
end
|
175
|
-
assert_raises SDKInvalidArgException do
|
175
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
176
176
|
inst.update(5, '')
|
177
177
|
end
|
178
178
|
end
|
@@ -184,7 +184,7 @@ class HandlersTest < MiniTest::Test
|
|
184
184
|
else
|
185
185
|
inst = e[0].new(LeanTesting::Client.new)
|
186
186
|
end
|
187
|
-
assert_raises SDKInvalidArgException do
|
187
|
+
assert_raises LeanTesting::SDKInvalidArgException do
|
188
188
|
inst.update(5, {})
|
189
189
|
end
|
190
190
|
end
|
@@ -196,19 +196,19 @@ class HandlersTest < MiniTest::Test
|
|
196
196
|
|
197
197
|
# HAVE SECONDARIES
|
198
198
|
def test_PlatformHandlerHasTypes
|
199
|
-
assert_instance_of PlatformTypesHandler, PlatformHandler.new(LeanTesting::Client.new).types
|
199
|
+
assert_instance_of LeanTesting::PlatformTypesHandler, LeanTesting::PlatformHandler.new(LeanTesting::Client.new).types
|
200
200
|
end
|
201
201
|
def test_PlatformHandlerHasDevices
|
202
|
-
assert_instance_of PlatformDevicesHandler, PlatformHandler.new(LeanTesting::Client.new).devices
|
202
|
+
assert_instance_of LeanTesting::PlatformDevicesHandler, LeanTesting::PlatformHandler.new(LeanTesting::Client.new).devices
|
203
203
|
end
|
204
204
|
def test_PlatformHandlerHasOS
|
205
|
-
assert_instance_of PlatformOSHandler, PlatformHandler.new(LeanTesting::Client.new).os
|
205
|
+
assert_instance_of LeanTesting::PlatformOSHandler, LeanTesting::PlatformHandler.new(LeanTesting::Client.new).os
|
206
206
|
end
|
207
207
|
def test_PlatformHandlerHasBrowsers
|
208
|
-
assert_instance_of PlatformBrowsersHandler, PlatformHandler.new(LeanTesting::Client.new).browsers
|
208
|
+
assert_instance_of LeanTesting::PlatformBrowsersHandler, LeanTesting::PlatformHandler.new(LeanTesting::Client.new).browsers
|
209
209
|
end
|
210
210
|
def test_UserHandlerHasOrganizations
|
211
|
-
assert_instance_of UserOrganizationsHandler, UserHandler.new(LeanTesting::Client.new).organizations
|
211
|
+
assert_instance_of LeanTesting::UserOrganizationsHandler, LeanTesting::UserHandler.new(LeanTesting::Client.new).organizations
|
212
212
|
end
|
213
213
|
# END HAVE SECONDARIES
|
214
214
|
|