From babd298eca0586dce134d65586bf50410aacd035 Mon Sep 17 00:00:00 2001 From: Nejc Habjan Date: Sat, 28 Mar 2020 17:37:39 +0100 Subject: test(types): reproduce get_for_api splitting strings (#1057) --- gitlab/tests/test_types.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'gitlab/tests') diff --git a/gitlab/tests/test_types.py b/gitlab/tests/test_types.py index 5b9f2ca..3613383 100644 --- a/gitlab/tests/test_types.py +++ b/gitlab/tests/test_types.py @@ -51,11 +51,19 @@ class TestListAttribute(unittest.TestCase): o.set_from_cli(" ") self.assertEqual([], o.get()) - def test_get_for_api(self): + def test_get_for_api_from_cli(self): o = types.ListAttribute() o.set_from_cli("foo,bar,baz") self.assertEqual("foo,bar,baz", o.get_for_api()) + def test_get_for_api_from_list(self): + o = types.ListAttribute(["foo", "bar", "baz"]) + self.assertEqual("foo,bar,baz", o.get_for_api()) + + def test_get_for_api_does_not_split_string(self): + o = types.ListAttribute("foo") + self.assertEqual("foo", o.get_for_api()) + class TestLowercaseStringAttribute(unittest.TestCase): def test_get_for_api(self): -- cgit v1.2.1