File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 18
18
from __future__ import print_function
19
19
from __future__ import division
20
20
from __future__ import absolute_import
21
+ import base64
21
22
import copy
22
23
import itertools
23
24
import json
@@ -922,6 +923,14 @@ class ProjectFile(GitlabObject):
922
923
shortPrintAttr = 'file_path'
923
924
getRequiresId = False
924
925
926
+ def decode (self ):
927
+ """Returns the decoded content.
928
+
929
+ Returns:
930
+ (str): the decoded content.
931
+ """
932
+ return base64 .b64decode (self .content )
933
+
925
934
926
935
class ProjectFileManager (BaseManager ):
927
936
obj_cls = ProjectFile
Original file line number Diff line number Diff line change 110
110
'branch_name' : 'master' ,
111
111
'content' : 'Initial content' ,
112
112
'commit_message' : 'New commit' })
113
+ assert (readme .decode () == 'Initial content' )
113
114
114
115
# labels
115
116
label1 = admin_project .labels .create ({'name' : 'label1' , 'color' : '#778899' })
You can’t perform that action at this time.
0 commit comments