sonarqube happy as well
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-05-22 00:26:38 +02:00
parent 3485bf5123
commit 887ed5c0ef
7 changed files with 24 additions and 12 deletions

View File

@ -1,5 +1,5 @@
from unittest.mock import MagicMock, patch
from app.languages import getProject, helmSet
from app.languages import get_project, helm_set
import gitlab
from gitlab.v4.objects import ProjectManager as pm
@ -126,21 +126,21 @@ def test_get_project():
'access_level': 50,
'notification_level': 3},
'group_access': None}}
with patch.object(pm, 'get', return_value=project_object) as mock_method:
with patch.object(pm, 'get', return_value=project_object):
gl = gitlab.Gitlab()
project = getProject(gl, 'root/test')
project = get_project(gl, 'root/test')
assert project['id'] == 34
def test_get_language():
getLanguage = MagicMock(return_value=[('Go', 100.0)])
get_language = MagicMock(return_value=[('Go', 100.0)])
expected = [('Go', 100.0)]
actual = getLanguage("project")
actual = get_language("project")
assert expected == actual
def test_helm_set():
excepted = '--set global.language[0]=Go'
actual = helmSet([('Go', 100.0)])
actual = helm_set([('Go', 100.0)])
assert excepted == actual