Exemplo n.º 1
0
class TestRedmine(TestCase):
    """ Make sure to provide ``REDMINE_HOST`` and ``REDMINE_API_KEY``
        environment variables to execute this test.
    """

    def setUp(self):
        self.r = Redmine(host=os.environ.get('COPYDOG_REDMINE_HOST'),
                         api_key=os.environ.get('COPYDOG_REDMINE_API_KEY'))

    def test_connect_public_api(self):
        r = Redmine(host='http://redmine.org')
        issues = r.issues()
        self.assertTrue(isinstance(issues, types.GeneratorType))
        self.assertTrue(next(issues), Issue)

    def test_connect_protected_api(self):
        issues = self.r.issues()
        self.assertTrue(next(issues), Issue)

    def test_projects(self):
        projects = self.r.projects()
        self.assertTrue(type(next(projects)) is Project)

    def test_issues_limit(self):
        issues = self.r.issues(limit=1)
        self.assertTrue(len(list(issues)) <= 1)

    def test_statuses(self):
        statuses = self.r.statuses()
        self.assertTrue(type(next(statuses, Status())) is Status)
Exemplo n.º 2
0
 def test_connect_public_api(self):
     r = Redmine(host='http://redmine.org')
     issues = r.issues()
     self.assertTrue(isinstance(issues, types.GeneratorType))
     self.assertTrue(next(issues), Issue)