Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove integration tests for deprecated routes and replace if replacement is public #379

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading