Skip to content

Commit

Permalink
Select backend based on backend name
Browse files Browse the repository at this point in the history
  • Loading branch information
LinuxMercedes committed Feb 12, 2018
1 parent d5a0e13 commit 43bad19
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion assigner/backends/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def wrapper(config, cmdargs, *args, **kwargs):
)
return func(config, GitlabBackend, cmdargs, *args, **kwargs)

if config.backend == "gitlab":
if config.backend["name"] == "gitlab":
return func(config, GitlabBackend, cmdargs, *args, **kwargs)
return func(config, MockBackend, cmdargs, *args, **kwargs)
return wrapper
6 changes: 5 additions & 1 deletion assigner/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,8 @@ def setUp(self):
)

self.mock_config = self.mock_config_class.return_value.__enter__.return_value
self.mock_config.backend = "gitlab"
self.mock_config.backend = {
"name": "gitlab",
"host": " xxx gitlab host xxx ",
"token": " xxx gitlab token xxx ",
}

0 comments on commit 43bad19

Please sign in to comment.