class TestMethods(object):
    """TODO: doc class"""

    def setup_method(self, test_method, **kwargs):
        """TODO: doc method"""
        if 'skipIf' in dir(test_method) and test_method.skipIf.args[0]:
            pytest.skip(test_method.skipIf.args[1])
            return
        self.tlm = TLManager(settings=CONFIG)

    def test_get_tprojects_minimal_one(self):
        """TestCase: test_get_tprojects_minimal_one
            At least must exist one TestProject
        """
        tprojects = self.tlm.api_tprojects()
        if len(tprojects) < 1:
            raise AssertionError("Not empty Test Projects")

    @pytest.mark.skipIf(True, "Issue oneped at qatestlink library, #52")
    @pytest.mark.raises(exception=ResponseException)
    def test_raises_tprojects_baddevkey(self):
        """TestCase: test_raises_tprojects_baddevkey"""
        tprojects = self.tlm.api_tprojects(dev_key='willfail')
        if len(tprojects) >= 0:
            raise AssertionError("Not empty Test Projects")
class TestMethods(object):
    """TODO: doc class"""

    def setup_method(self, test_method, **kwargs):
        """TODO: doc method"""
        if 'skipIf' in dir(test_method) and test_method.skipIf.args[0]:
            pytest.skip(test_method.skipIf.args[1])
            return
        self.tlm = TLManager(settings=CONFIG)

    def test_checkdevkey(self):
        """TestCase: test_checkdevkey
            Login success with valid config
        """
        is_logged = self.tlm.api_login()
        if not is_logged:
            raise AssertionError(
                "API_KEY it's invalid when must be valid")

    @pytest.mark.raises(exception=ResponseException)
    def test_raises_checkdevkey(self):
        """TestCase: test_raises_checkdevkey"""
        is_logged = self.tlm.api_login(dev_key='willfail')
        if is_logged:
            raise AssertionError(
                "API_KEY it's invalid when must be valid")
 def setup_method(self, test_method, **kwargs):
     """TODO: doc method"""
     super(TestTProjects,
           self).setup_method(test_method,
                              **{"tlm": TLManager(settings=CONFIG)})
     # Tplan must be assigned to testproject to get tests working
     self.tproject_name = 'testlink-tests'
     self.tplan_name = 'xmlrpc'
示例#4
0
class TestMethods(object):
    """TODO: doc class"""
    def setup_method(self, test_method, **kwargs):
        """TODO: doc method"""
        if 'skipIf' in dir(test_method) and test_method.skipIf.args[0]:
            pytest.skip(test_method.skipIf.args[1])
            return
        self.tlm = TLManager(settings=CONFIG)

    def test_checkdevkey(self):
        """TestCase: test_checkdevkey
            Login success with valid config
        """
        is_logged = self.tlm.api_login()
        if not is_logged:
            raise AssertionError("API_KEY it's invalid when must be valid")

    @pytest.mark.raises(exception=ResponseException)
    def test_raises_checkdevkey(self):
        """TestCase: test_raises_checkdevkey"""
        is_logged = self.tlm.api_login(dev_key='willfail')
        if is_logged:
            raise AssertionError("API_KEY it's invalid when must be valid")
class TestMethods(object):
    """TODO: doc class"""
    def setup_method(self, test_method, **kwargs):
        """TODO: doc method"""
        if 'skipIf' in dir(test_method) and test_method.skipIf.args[0]:
            pytest.skip(test_method.skipIf.args[1])
            return
        self.tlm = TLManager(settings=CONFIG)

    def test_get_tprojects_minimal_one(self):
        """TestCase: test_get_tprojects_minimal_one
            At least must exist one TestProject
        """
        tprojects = self.tlm.api_tprojects()
        if len(tprojects) < 1:
            raise AssertionError("Not empty Test Projects")

    @pytest.mark.skipIf(True, "Issue oneped at qatestlink library, #52")
    @pytest.mark.raises(exception=ResponseException)
    def test_raises_tprojects_baddevkey(self):
        """TestCase: test_raises_tprojects_baddevkey"""
        tprojects = self.tlm.api_tprojects(dev_key='willfail')
        if len(tprojects) >= 0:
            raise AssertionError("Not empty Test Projects")
示例#6
0
 def setup_method(self, test_method, **kwargs):
     """Configure self.attribute.
     If skipIf mark applied and True as first param for args tuple
         then not open bot
     """
     if 'skipIf' in dir(test_method) and test_method.skipIf.args[0]:
         pytest.skip(test_method.skipIf.args[1])
         return
     settings = kwargs.get('settings')
     tlm = kwargs.get('tlm')
     if settings is None and tlm is None:
         raise Exception(("Not settings or TLManager "
                          "instance provided, read README first"))
     if tlm is None:
         tlm = TLManager(settings=settings)
     self.tlm = tlm
     self.log = tlm.log
     self.log.info("Started testcase named='{}'".format(
         test_method.__name__))
示例#7
0
 def setup_method(self, test_method, **kwargs):
     """TODO: doc method"""
     if 'skipIf' in dir(test_method) and test_method.skipIf.args[0]:
         pytest.skip(test_method.skipIf.args[1])
         return
     self.tlm = TLManager(settings=CONFIG)
 def setup_method(self, test_method, **kwargs):
     """TODO: doc method"""
     if 'skipIf' in dir(test_method) and test_method.skipIf.args[0]:
         pytest.skip(test_method.skipIf.args[1])
         return
     self.tlm = TLManager(settings=CONFIG)
示例#9
0
 def setup_class(cls):
     """TODO: doc method"""
     cls.testlink_manager = TLManager()
     cls.tc = TestCase()
示例#10
0
 def setup_method(self, test_method, **kwargs):
     """TODO: doc method"""
     super(TestTProject,
           self).setup_method(test_method,
                              **{"tlm": TLManager(settings=CONFIG)})
 def setUpClass(cls):
     """TODO: doc method"""
     cls.testlink_manager = TLManager()