diff options
Diffstat (limited to 'gitlab/tests/test_gitlab.py')
| -rw-r--r-- | gitlab/tests/test_gitlab.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gitlab/tests/test_gitlab.py b/gitlab/tests/test_gitlab.py index dc31875..337320f 100644 --- a/gitlab/tests/test_gitlab.py +++ b/gitlab/tests/test_gitlab.py @@ -27,9 +27,25 @@ from httmock import HTTMock # noqa from httmock import response # noqa from httmock import urlmatch # noqa +import gitlab from gitlab import * # noqa +class TestSanitize(unittest.TestCase): + def test_do_nothing(self): + self.assertEqual(1, gitlab._sanitize(1)) + self.assertEqual(1.5, gitlab._sanitize(1.5)) + self.assertEqual("foo", gitlab._sanitize("foo")) + + def test_slash(self): + self.assertEqual("foo%2Fbar", gitlab._sanitize("foo/bar")) + + def test_dict(self): + source = {"url": "foo/bar", "id": 1} + expected = {"url": "foo%2Fbar", "id": 1} + self.assertEqual(expected, gitlab._sanitize(source)) + + class TestGitlabRawMethods(unittest.TestCase): def setUp(self): self.gl = Gitlab("http://localhost", private_token="private_token", |
