Exemple #1
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)
Exemple #2
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)
Exemple #3
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")
Exemple #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")
Exemple #5
0
    def test_get_projects(self):
        """
        Tests that we get a correct set of projects.
        """

        redmine = Redmine("http://example.com", "abc123")
        self.assertEqual([project.name for project in redmine.projects], ["Test Project 1", "Test Project 2", "Test Project 3", "Test Project 4"])
    def test_get_issues(self):
        """
        Tests that we get a correct set of projects.
        """

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

        project = redmine.projects[0]

        self.assertEqual([issue.id for issue in project.issues], [1, 2, 3, 4])
Exemple #7
0
    def test_project_dates(self):
        """
        Tests that the project properties which are dates have been set correctly.
        """

        redmine = Redmine("http://example.com", "abc123")
        project = redmine.projects[0]

        self.assertEqual(project.created_on, datetime.datetime(2011, 11, 4, 9, 38, 41))
        self.assertEqual(project.updated_on, datetime.datetime(2011, 11, 4, 9, 38, 41))
Exemple #8
0
    def test_project_properties(self):
        """
        Tests that the project properties have been set correctly.
        """

        redmine = Redmine("http://example.com", "abc123")
        project = redmine.projects[0]

        self.assertEqual(project.name, "Test Project 1")
        self.assertEqual(project.identifier, "test-project-1")
        self.assertEqual(project.description, "Test Project 1 Description")
Exemple #9
0
        user_id = None
    return user_id

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