Exemplo n.º 1
0
    def test_get_project_by_slug_doesnt_exist(self):
        """
        Tests getting a project by identifier.
        """

        redmine = Redmine("http://example.com", "abc123")
        project = redmine.get_project(identifier = "abc123")

        self.assertEqual(project, None)
Exemplo n.º 2
0
    def test_get_project_by_slug(self):
        """
        Tests getting a project by identifier.
        """

        redmine = Redmine("http://example.com", "abc123")
        project = redmine.get_project(identifier = "test-project-4")

        self.assertEqual(project.name, "Test Project 4")
Exemplo n.º 3
0
    def test_get_project_by_id_doesnt_exist(self):
        """
        Tests getting a project by id where the id doesn't exist.
        """

        redmine = Redmine("http://example.com", "abc123")
        project = redmine.get_project(id = 5)

        self.assertEqual(project, None)
Exemplo n.º 4
0
    def test_get_project_by_id(self):
        """
        Tests getting a project by id.
        """

        redmine = Redmine("http://example.com", "abc123")
        project = redmine.get_project(id = 2)

        self.assertEqual(project.name, "Test Project 2")
Exemplo n.º 5
0
def getPoint(issue):
    '''Get Redmine issue points'''
    points = None
    for field in issue.custom_fields:
        if field['name'] == "Points":
            points = field['value']
            break
    return points

if __name__ == '__main__':

    kanban = LeankitKanban(LEANKIT_HOST, LEANKIT_LOGIN, LEANKIT_PASSWORD)
    redmine = Redmine(READMINE_URL, READMINE_API_KEY)

    print "Getting RedMine project '%s' ... " % READMINE_PROJECT_IDENTIFIER,
    project = redmine.get_project(identifier = READMINE_PROJECT_IDENTIFIER)
    print "[yes]"
    # for b in kanban.getBoards():
    #     print b.title

    print "Getting LeanKit board '%s'..." % LEANKIT_BOARDNAME,
    board = kanban.getBoard(title = LEANKIT_BOARDNAME)
    
    #filling map of card types from board
    for type_id in board.cardtypes:
        CARDTYPE_MAPPING[board.cardtypes[type_id].name] = type_id
        
    #filling map of Leankit users from board
    for user_id in board.users_by_id:
        USER_MAPPING[board.users_by_id[user_id].full_name] = user_id