diff options
author | Nejc Habjan <nejc.habjan@siemens.com> | 2022-07-03 23:43:53 +0200 |
---|---|---|
committer | John Villalovos <john@sodarock.com> | 2022-07-03 18:33:38 -0700 |
commit | 97e0eb9267202052ed14882258dceca0f6c4afd7 (patch) | |
tree | cbd00f826a80c9216193be611a5c61faee6fe2ce /tests/functional/api/test_variables.py | |
parent | 04c6063183d94fe8970bdad485cf8221db9c31a8 (diff) | |
download | gitlab-97e0eb9267202052ed14882258dceca0f6c4afd7.tar.gz |
test(functional): replace len() calls with list membership checks
Diffstat (limited to 'tests/functional/api/test_variables.py')
-rw-r--r-- | tests/functional/api/test_variables.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/functional/api/test_variables.py b/tests/functional/api/test_variables.py index d20ebba..867e563 100644 --- a/tests/functional/api/test_variables.py +++ b/tests/functional/api/test_variables.py @@ -9,7 +9,7 @@ https://docs.gitlab.com/ee/api/group_level_variables.html def test_instance_variables(gl): variable = gl.variables.create({"key": "key1", "value": "value1"}) assert variable.value == "value1" - assert len(gl.variables.list()) == 1 + assert variable in gl.variables.list() variable.value = "new_value1" variable.save() @@ -17,13 +17,13 @@ def test_instance_variables(gl): assert variable.value == "new_value1" variable.delete() - assert len(gl.variables.list()) == 0 + assert variable not in gl.variables.list() def test_group_variables(group): variable = group.variables.create({"key": "key1", "value": "value1"}) assert variable.value == "value1" - assert len(group.variables.list()) == 1 + assert variable in group.variables.list() variable.value = "new_value1" variable.save() @@ -31,13 +31,13 @@ def test_group_variables(group): assert variable.value == "new_value1" variable.delete() - assert len(group.variables.list()) == 0 + assert variable not in group.variables.list() def test_project_variables(project): variable = project.variables.create({"key": "key1", "value": "value1"}) assert variable.value == "value1" - assert len(project.variables.list()) == 1 + assert variable in project.variables.list() variable.value = "new_value1" variable.save() @@ -45,4 +45,4 @@ def test_project_variables(project): assert variable.value == "new_value1" variable.delete() - assert len(project.variables.list()) == 0 + assert variable not in project.variables.list() |