@@ -40,17 +40,22 @@ func TestACLListCommand_run(t *testing.T) {
4040 "client error" : {
4141 cmd : ACLListCommand {},
4242 accessrules : fakeclient.AccessRuleService {
43- Lister : & fakeclient. AccessRuleLister {
44- Err : testError ,
43+ ListFunc : func ( path string , depth int , ancestors bool ) ([] * api. AccessRule , error ) {
44+ return nil , testError
4545 },
4646 },
4747 err : testError ,
4848 },
4949 "0 access rules" : {
5050 cmd : ACLListCommand {},
5151 accessrules : fakeclient.AccessRuleService {
52- Lister : & fakeclient.AccessRuleLister {
53- ReturnsAccessRules : []* api.AccessRule {},
52+ ListFunc : func (path string , depth int , ancestors bool ) ([]* api.AccessRule , error ) {
53+ return []* api.AccessRule {}, nil
54+ },
55+ },
56+ dirs : fakeclient.DirService {
57+ GetTreeFunc : func (path string , depth int , ancestors bool ) (* api.Tree , error ) {
58+ return nil , nil
5459 },
5560 },
5661 out : "PATH PERMISSIONS LAST EDITED ACCOUNT\n " ,
@@ -62,8 +67,13 @@ func TestACLListCommand_run(t *testing.T) {
6267 ancestors : true ,
6368 },
6469 accessrules : fakeclient.AccessRuleService {
65- Lister : & fakeclient.AccessRuleLister {
66- ReturnsAccessRules : []* api.AccessRule {},
70+ ListFunc : func (path string , depth int , ancestors bool ) ([]* api.AccessRule , error ) {
71+ return []* api.AccessRule {}, nil
72+ },
73+ },
74+ dirs : fakeclient.DirService {
75+ GetTreeFunc : func (path string , depth int , ancestors bool ) (* api.Tree , error ) {
76+ return nil , nil
6777 },
6878 },
6979 argPath : api .DirPath ("namespace/repo/dir" ),
@@ -78,8 +88,8 @@ func TestACLListCommand_run(t *testing.T) {
7888 },
7989 },
8090 accessrules : fakeclient.AccessRuleService {
81- Lister : & fakeclient. AccessRuleLister {
82- ReturnsAccessRules : []* api.AccessRule {
91+ ListFunc : func ( path string , depth int , ancestors bool ) ([] * api. AccessRule , error ) {
92+ return []* api.AccessRule {
8393 {
8494 Account : & api.Account {
8595 Name : "another dev" ,
@@ -104,12 +114,12 @@ func TestACLListCommand_run(t *testing.T) {
104114 Permission : api .PermissionAdmin ,
105115 LastChangedAt : time .Date (2018 , 1 , 1 , 1 , 1 , 1 , 1 , time .UTC ),
106116 },
107- },
117+ }, nil
108118 },
109119 },
110120 dirs : fakeclient.DirService {
111- TreeGetter : fakeclient. TreeGetter {
112- ReturnsTree : & api.Tree {
121+ GetTreeFunc : func ( path string , depth int , ancestors bool ) ( * api. Tree , error ) {
122+ return & api.Tree {
113123 ParentPath : "namespace" ,
114124 Dirs : map [uuid.UUID ]* api.Dir {
115125 dir1ID : {
@@ -126,7 +136,7 @@ func TestACLListCommand_run(t *testing.T) {
126136 Name : "repo" ,
127137 DirID : dir1ID ,
128138 },
129- },
139+ }, nil
130140 },
131141 },
132142 out : "PATH PERMISSIONS LAST EDITED ACCOUNT\n " +
0 commit comments