From b0ae185faa7a0b92681a60e6d5d7b85d70085729 Mon Sep 17 00:00:00 2001 From: Julian Locke Date: Tue, 2 Apr 2024 13:02:11 -0400 Subject: [PATCH] Remove integration tests for deprecated routes and replace if replacement is public --- .../IntegrationTests/TestClasses.h | 5 +- .../IntegrationTests/TestClasses.m | 118 ++++-------------- 2 files changed, 25 insertions(+), 98 deletions(-) diff --git a/TestObjectiveDropbox/IntegrationTests/TestClasses.h b/TestObjectiveDropbox/IntegrationTests/TestClasses.h index 3ab97fbb0..3ba3e50ca 100644 --- a/TestObjectiveDropbox/IntegrationTests/TestClasses.h +++ b/TestObjectiveDropbox/IntegrationTests/TestClasses.h @@ -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 @@ -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; diff --git a/TestObjectiveDropbox/IntegrationTests/TestClasses.m b/TestObjectiveDropbox/IntegrationTests/TestClasses.m index 6da5e2898..b592e7a1d 100644 --- a/TestObjectiveDropbox/IntegrationTests/TestClasses.m +++ b/TestObjectiveDropbox/IntegrationTests/TestClasses.m @@ -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]; @@ -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]; @@ -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 */ @@ -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];