-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from netzulo/req_tprojects
[qatl] fixing #7 'tl.getProjects'
- Loading branch information
Showing
11 changed files
with
306 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# -*- coding: utf-8 -*- | ||
"""TODO: doc module""" | ||
|
||
|
||
class ModelBase(object): | ||
"""TODO: doc class""" | ||
|
||
def __init__(self): | ||
"""TODO: doc method""" | ||
pass | ||
|
||
|
||
class TProject(ModelBase): | ||
"""TODO: doc class""" | ||
|
||
_res_members = None | ||
|
||
# Testlink object properties | ||
id = None | ||
name = None | ||
is_public = None | ||
|
||
def __init__(self, res_members): | ||
"""TODO: doc method""" | ||
super(TProject, self).__init__() | ||
if res_members is None: | ||
raise Exception('Bad param, res_member can\'t be None') | ||
if len(res_members) <= 0: | ||
raise Exception( | ||
'Bad param, res_member can\'t be empty list') | ||
self._res_members = res_members | ||
self._load() | ||
|
||
def _load(self): | ||
for res_member in self._res_members: | ||
name = res_member.name | ||
value = res_member.value | ||
if name == 'id': | ||
self.id = value | ||
if name == 'name': | ||
self.name = value | ||
if name == 'is_public': | ||
self.is_public = value | ||
|
||
def __repr__(self): | ||
return "TProject: id={}, name={}, is_public={}".format( | ||
self.id, | ||
self.name, | ||
self.is_public | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# -*- coding: utf-8 -*- | ||
"""TODO: doc module""" | ||
|
||
|
||
import logging | ||
|
||
|
||
class LoggerManager(object): | ||
""" | ||
Start logger named 'qatestlink' | ||
with DEBUG level and just with console reporting | ||
""" | ||
|
||
log = None | ||
|
||
def __init__(self, log_level=None): | ||
"""Start logger""" | ||
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') | ||
logger = logging.getLogger('qatestlink') | ||
logger_stream = logging.StreamHandler() | ||
if log_level is None or log_level == 'DEBUG': | ||
log_level = logging.DEBUG | ||
elif log_level == 'INFO': | ||
log_level = logging.INFO | ||
elif log_level == 'WARNING': | ||
log_level = logging.WARNING | ||
elif log_level == 'ERROR': | ||
log_level = logging.ERROR | ||
elif log_level == 'CRITICAL': | ||
log_level = logging.CRITICAL | ||
logger.setLevel(log_level) | ||
logger_stream.setLevel(log_level) | ||
logger_stream.setFormatter(formatter) | ||
logger.addHandler(logger_stream) | ||
# alias to improve logging calls | ||
self.log = logger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.