Completed
Push — master ( 32acac...19ae40 )
by Lakshmi
11:34
created

ListBranchesAction.run()   A

Complexity

Conditions 2

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
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