Completed
Pull Request — master (#543)
by
unknown
02:30
created

ListBranchesAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 2
1
from lib.action import TravisCI
2
3
4
class ListBranchesAction(TravisCI):
5
    def run(self, repo_id):
6
        """
7
        Listing branches for a give Repository
8
        """
9
        path = '/repos/' + str(repo_id) + '/branches'
10
        response = self._perform_request(path, method="GET")
11
        data = response.json()
12
        branches = []
13
        for arg in data['commits']:
14
            branches.append(arg['branch'])
15
        return branches
16