summaryrefslogtreecommitdiff
path: root/gitlab/tests/test_gitlabobject.py
diff options
context:
space:
mode:
Diffstat (limited to 'gitlab/tests/test_gitlabobject.py')
-rw-r--r--gitlab/tests/test_gitlabobject.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/gitlab/tests/test_gitlabobject.py b/gitlab/tests/test_gitlabobject.py
index 99a184b..2726854 100644
--- a/gitlab/tests/test_gitlabobject.py
+++ b/gitlab/tests/test_gitlabobject.py
@@ -21,6 +21,7 @@ from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
+import json
try:
import unittest
except ImportError:
@@ -150,6 +151,14 @@ class TestGitlabObject(unittest.TestCase):
email="testuser@test.com", password="testpassword",
ssl_verify=True)
+ def test_json(self):
+ gl_object = CurrentUser(self.gl, data={"username": "testname"})
+ json_str = gl_object.json()
+ data = json.loads(json_str)
+ self.assertIn("id", data)
+ self.assertEqual(data["username"], "testname")
+ self.assertEqual(data["gitlab"]["url"], "http://localhost/api/v3")
+
def test_list_not_implemented(self):
self.assertRaises(NotImplementedError, CurrentUser.list, self.gl)