summaryrefslogtreecommitdiff
path: root/gitlab/tests
diff options
context:
space:
mode:
authorMax Wittig <max.wittig@siemens.com>2020-04-02 08:40:57 +0200
committerGitHub <noreply@github.com>2020-04-02 08:40:57 +0200
commit50fcd1237613645031410386e87b96b81ef5fb78 (patch)
tree84ab6c9ee695281235155f7ad2b138684fc8a322 /gitlab/tests
parentc5904c4c2e79ec302ff0de20bcb2792be4924bbe (diff)
parenta26e58585b3d82cf1a3e60a3b7b3bfd7f51d77e5 (diff)
downloadgitlab-50fcd1237613645031410386e87b96b81ef5fb78.tar.gz
Merge pull request #1058 from python-gitlab/fix/listattribute-get-api-splits-string
Fix: ListAttribute get_for_api() splits strings
Diffstat (limited to 'gitlab/tests')
-rw-r--r--gitlab/tests/test_types.py10
1 files changed, 9 insertions, 1 deletions
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):