Skip to content

Commit

Permalink
Remove integration tests for deprecated routes and replace if replace…
Browse files Browse the repository at this point in the history
…ment is public
  • Loading branch information
julianlocke committed Apr 2, 2024
1 parent 2a69d77 commit b0ae185
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 98 deletions.
5 changes: 1 addition & 4 deletions TestObjectiveDropbox/IntegrationTests/TestClasses.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,6 @@
- (void)linkedAppsListMemberLinkedApps:(void (^_Nonnull)(void))nextTest;
- (void)linkedAppsListMembersLinkedApps:(void (^_Nonnull)(void))nextTest;
- (void)getInfo:(void (^_Nonnull)(void))nextTest;
- (void)reportsGetActivity:(void (^_Nonnull)(void))nextTest;
- (void)reportsGetDevices:(void (^_Nonnull)(void))nextTest;
- (void)reportsGetMembership:(void (^_Nonnull)(void))nextTest;
- (void)reportsGetStorage:(void (^_Nonnull)(void))nextTest;

// TeamMemberManagement

Expand All @@ -171,6 +167,7 @@
- (void)membersAdd:(void (^_Nonnull)(void))nextTest;
- (void)membersGetInfo:(void (^_Nonnull)(void))nextTest;
- (void)membersList:(void (^_Nonnull)(void))nextTest;
- (void)membersListDevices:(void (^_Nonnull)(void))nextTest;
- (void)membersSendWelcomeEmail:(void (^_Nonnull)(void))nextTest;
- (void)membersSetAdminPermissions:(void (^_Nonnull)(void))nextTest;
- (void)membersSetProfile:(void (^_Nonnull)(void))nextTest;
Expand Down
118 changes: 24 additions & 94 deletions TestObjectiveDropbox/IntegrationTests/TestClasses.m
Original file line number Diff line number Diff line change
Expand Up @@ -310,20 +310,8 @@ - (void)testTeamMemberFileAcessActions:(void (^)(TeamTests *))nextTest {
[TestFormat printTestEnd];
nextTest(teamTests);
};
void (^reportsGetStorage)(void) = ^{
[teamTests reportsGetStorage:end];
};
void (^reportsGetMembership)(void) = ^{
[teamTests reportsGetMembership:reportsGetStorage];
};
void (^reportsGetDevices)(void) = ^{
[teamTests reportsGetDevices:reportsGetMembership];
};
void (^reportsGetActivity)(void) = ^{
[teamTests reportsGetActivity:reportsGetDevices];
};
void (^getInfo)(void) = ^{
[teamTests getInfo:reportsGetActivity];
[teamTests getInfo:end];
};
void (^linkedAppsListMembersLinkedApps)(void) = ^{
[teamTests linkedAppsListMembersLinkedApps:getInfo];
Expand Down Expand Up @@ -371,8 +359,11 @@ - (void)testTeamMemberManagementActions:(void (^)(void))nextTest {
void (^membersList)(void) = ^{
[teamTests membersList:membersSendWelcomeEmail];
};
void (^membersListDevices)(void) = ^{
[teamTests membersListDevices:membersList];
};
void (^membersGetInfo)(void) = ^{
[teamTests membersGetInfo:membersList];
[teamTests membersGetInfo:membersListDevices];
};
void (^membersAdd)(void) = ^{
[teamTests membersAdd:membersGetInfo];
Expand Down Expand Up @@ -1815,86 +1806,6 @@ - (void)getInfo:(void (^)(void))nextTest {
}];
}

- (void)reportsGetActivity:(void (^)(void))nextTest {
[TestFormat printSubTestBegin:NSStringFromSelector(_cmd)];
NSCalendar *calendar = [NSCalendar currentCalendar];
NSDate *twoDaysAgo = [calendar dateByAddingUnit:NSCalendarUnitDay value:-2 toDate:[NSDate new] options:0];
[[[_tester.team reportsGetActivity:twoDaysAgo endDate:[NSDate new]]
setResponseBlock:^(DBTEAMGetActivityReport *result, DBTEAMDateRangeError *routeError, DBRequestError *error) {
if (result) {
MyLog(@"%@\n", result);
[TestFormat printSubTestEnd:NSStringFromSelector(_cmd)];
nextTest();
} else {
[TestFormat abort:error routeError:routeError];
}
} queue:[NSOperationQueue new]] setProgressBlock:^(int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend) {
[TestFormat printSentProgress:bytesSent
totalBytesSent:totalBytesSent
totalBytesExpectedToSend:totalBytesExpectedToSend];
}];
}

- (void)reportsGetDevices:(void (^)(void))nextTest {
[TestFormat printSubTestBegin:NSStringFromSelector(_cmd)];
NSCalendar *calendar = [NSCalendar currentCalendar];
NSDate *twoDaysAgo = [calendar dateByAddingUnit:NSCalendarUnitDay value:-2 toDate:[NSDate new] options:0];
[[[_tester.team reportsGetDevices:twoDaysAgo endDate:[NSDate new]]
setResponseBlock:^(DBTEAMGetDevicesReport *result, DBTEAMDateRangeError *routeError, DBRequestError *error) {
if (result) {
MyLog(@"%@\n", result);
[TestFormat printSubTestEnd:NSStringFromSelector(_cmd)];
nextTest();
} else {
[TestFormat abort:error routeError:routeError];
}
} queue:[NSOperationQueue new]] setProgressBlock:^(int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend) {
[TestFormat printSentProgress:bytesSent
totalBytesSent:totalBytesSent
totalBytesExpectedToSend:totalBytesExpectedToSend];
}];
}

- (void)reportsGetMembership:(void (^)(void))nextTest {
[TestFormat printSubTestBegin:NSStringFromSelector(_cmd)];
NSCalendar *calendar = [NSCalendar currentCalendar];
NSDate *twoDaysAgo = [calendar dateByAddingUnit:NSCalendarUnitDay value:-2 toDate:[NSDate new] options:0];
[[[_tester.team reportsGetMembership:twoDaysAgo endDate:[NSDate new]]
setResponseBlock:^(DBTEAMGetMembershipReport *result, DBTEAMDateRangeError *routeError, DBRequestError *error) {
if (result) {
MyLog(@"%@\n", result);
[TestFormat printSubTestEnd:NSStringFromSelector(_cmd)];
nextTest();
} else {
[TestFormat abort:error routeError:routeError];
}
} queue:[NSOperationQueue new]] setProgressBlock:^(int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend) {
[TestFormat printSentProgress:bytesSent
totalBytesSent:totalBytesSent
totalBytesExpectedToSend:totalBytesExpectedToSend];
}];
}

- (void)reportsGetStorage:(void (^)(void))nextTest {
[TestFormat printSubTestBegin:NSStringFromSelector(_cmd)];
NSCalendar *calendar = [NSCalendar currentCalendar];
NSDate *twoDaysAgo = [calendar dateByAddingUnit:NSCalendarUnitDay value:-2 toDate:[NSDate new] options:0];
[[[_tester.team reportsGetStorage:twoDaysAgo endDate:[NSDate new]]
setResponseBlock:^(DBTEAMGetStorageReport *result, DBTEAMDateRangeError *routeError, DBRequestError *error) {
if (result) {
MyLog(@"%@\n", result);
[TestFormat printSubTestEnd:NSStringFromSelector(_cmd)];
nextTest();
} else {
[TestFormat abort:error routeError:routeError];
}
} queue:[NSOperationQueue new]] setProgressBlock:^(int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend) {
[TestFormat printSentProgress:bytesSent
totalBytesSent:totalBytesSent
totalBytesExpectedToSend:totalBytesExpectedToSend];
}];
}

/**
Permission: TEAM member management
*/
Expand Down Expand Up @@ -2179,6 +2090,25 @@ - (void)membersList:(void (^)(void))nextTest {
}];
}

- (void)membersListDevices:(void (^)(void))nextTest {
[TestFormat printSubTestBegin:NSStringFromSelector(_cmd)];

[[[_tester.team devicesListMembersDevices]
setResponseBlock:^(DBTEAMListMembersDevicesResult *result, DBTEAMListMembersDevicesError *routeError, DBRequestError *error) {
if (result) {
MyLog(@"%@\n", result);
[TestFormat printSubTestEnd:NSStringFromSelector(_cmd)];
nextTest();
} else {
[TestFormat abort:error routeError:routeError];
}
} queue:[NSOperationQueue new]] setProgressBlock:^(int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend) {
[TestFormat printSentProgress:bytesSent
totalBytesSent:totalBytesSent
totalBytesExpectedToSend:totalBytesExpectedToSend];
}];
}

- (void)membersSendWelcomeEmail:(void (^)(void))nextTest {
[TestFormat printSubTestBegin:NSStringFromSelector(_cmd)];
DBTEAMUserSelectorArg *userSelectArg = [[DBTEAMUserSelectorArg alloc] initWithTeamMemberId:_teamMemberId];
Expand Down

0 comments on commit b0ae185

Please sign in to comment.