diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2018-05-19 17:43:31 +0200 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2018-05-19 17:43:31 +0200 |
commit | 09d1ec04e52fc796cc25e1e29e73969c595e951d (patch) | |
tree | e3004bca039a91456c5309f0bffd244b83af1faf /gitlab/tests | |
parent | fe89b949922c028830dd49095432ba627d330186 (diff) | |
download | gitlab-09d1ec04e52fc796cc25e1e29e73969c595e951d.tar.gz |
Drop GetFromListMixin
Diffstat (limited to 'gitlab/tests')
-rw-r--r-- | gitlab/tests/test_gitlab.py | 6 | ||||
-rw-r--r-- | gitlab/tests/test_mixins.py | 20 |
2 files changed, 3 insertions, 23 deletions
diff --git a/gitlab/tests/test_gitlab.py b/gitlab/tests/test_gitlab.py index daa2694..34b60b9 100644 --- a/gitlab/tests/test_gitlab.py +++ b/gitlab/tests/test_gitlab.py @@ -517,9 +517,9 @@ class TestGitlab(unittest.TestCase): return response(200, content, headers, None, 5, request) with HTTMock(resp_get_issue): - data = self.gl.issues.get(2) - self.assertEqual(data.id, 2) - self.assertEqual(data.name, 'other_name') + data = self.gl.issues.list() + self.assertEqual(data[1].id, 2) + self.assertEqual(data[1].name, 'other_name') def test_users(self): @urlmatch(scheme="http", netloc="localhost", path="/api/v4/users/1", diff --git a/gitlab/tests/test_mixins.py b/gitlab/tests/test_mixins.py index 5c10597..c737953 100644 --- a/gitlab/tests/test_mixins.py +++ b/gitlab/tests/test_mixins.py @@ -238,26 +238,6 @@ class TestMixinMethods(unittest.TestCase): self.assertEqual(obj.foo, 'bar') self.assertRaises(StopIteration, obj_list.next) - def test_get_from_list_mixin(self): - class M(GetFromListMixin, FakeManager): - pass - - @urlmatch(scheme="http", netloc="localhost", path='/api/v4/tests', - method="get") - def resp_cont(url, request): - headers = {'Content-Type': 'application/json'} - content = '[{"id": 42, "foo": "bar"},{"id": 43, "foo": "baz"}]' - return response(200, content, headers, None, 5, request) - - with HTTMock(resp_cont): - mgr = M(self.gl) - obj = mgr.get(42) - self.assertIsInstance(obj, FakeObject) - self.assertEqual(obj.foo, 'bar') - self.assertEqual(obj.id, 42) - - self.assertRaises(GitlabGetError, mgr.get, 44) - def test_create_mixin_get_attrs(self): class M1(CreateMixin, FakeManager): pass |