Skip to content

Commit

Permalink
Add two more folders that have appeared on test account
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Cederstrand committed May 13, 2024
1 parent be0cd9f commit ae3bff0
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 13 deletions.
10 changes: 7 additions & 3 deletions exchangelib/folders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
Birthdays,
Calendar,
CalendarLogging,
CalendarSearchCache,
CommonViews,
Companies,
Conflicts,
Expand Down Expand Up @@ -68,6 +69,7 @@
PdpProfileV2Secured,
PeopleCentricConversationBuddies,
PeopleConnect,
PersonMetadata,
QedcDefaultRetention,
QedcLongRetention,
QedcMediumRetention,
Expand Down Expand Up @@ -134,6 +136,7 @@
"Birthdays",
"Calendar",
"CalendarLogging",
"CalendarSearchCache",
"CommonViews",
"Companies",
"Conflicts",
Expand Down Expand Up @@ -189,13 +192,14 @@
"PdpProfileV2Secured",
"PeopleCentricConversationBuddies",
"PeopleConnect",
"PersonMetadata",
"PublicFoldersRoot",
"QedcDefaultRetention",
"QedcMediumRetention",
"QedcLongRetention",
"QedcMediumRetention",
"QedcShortRetention",
"QuarantinedEmail",
"QuarantinedEmailDefaultCategory",
"PublicFoldersRoot",
"QuickContacts",
"RSSFeeds",
"RecipientCache",
Expand All @@ -217,8 +221,8 @@
"ServerFailures",
"SharePointNotifications",
"Sharing",
"Shortcuts",
"ShortNotes",
"Shortcuts",
"Signal",
"SingleFolderQuerySet",
"SkypeTeamsMessages",
Expand Down
28 changes: 18 additions & 10 deletions exchangelib/folders/known_folders.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,17 +525,7 @@ def is_deletable(self):
return False


class ExternalContacts(NonDeletableFolder):
DISTINGUISHED_FOLDER_ID = None
CONTAINER_CLASS = "IPF.Contact"
supported_item_models = (Contact, DistributionList)
LOCALIZED_NAMES = {
None: ("ExternalContacts",),
}


class AllTodoTasks(NonDeletableFolder):
DISTINGUISHED_FOLDER_ID = None
CONTAINER_CLASS = "IPF.Task"
supported_item_models = (Task,)
LOCALIZED_NAMES = {
Expand All @@ -557,6 +547,10 @@ class CalendarLogging(NonDeletableFolder):
}


class CalendarSearchCache(NonDeletableFolder):
CONTAINER_CLASS = "IPF.Appointment"


class CommonViews(NonDeletableFolder):
DEFAULT_ITEM_TRAVERSAL_DEPTH = ASSOCIATED
LOCALIZED_NAMES = {
Expand Down Expand Up @@ -585,6 +579,14 @@ class ExchangeSyncData(NonDeletableFolder):
pass


class ExternalContacts(NonDeletableFolder):
CONTAINER_CLASS = "IPF.Contact"
supported_item_models = (Contact, DistributionList)
LOCALIZED_NAMES = {
None: ("ExternalContacts",),
}


class Files(NonDeletableFolder):
CONTAINER_CLASS = "IPF.Files"
LOCALIZED_NAMES = {
Expand Down Expand Up @@ -650,6 +652,10 @@ class PassThroughSearchResults(NonDeletableFolder):
}


class PersonMetadata(NonDeletableFolder):
CONTAINER_CLASS = "IPF.Contact"


class PdpProfileV2Secured(NonDeletableFolder):
CONTAINER_CLASS = "IPF.StoreItem.PdpProfileSecured"

Expand Down Expand Up @@ -719,6 +725,7 @@ class WorkingSet(NonDeletableFolder):
AllTodoTasks,
Audits,
CalendarLogging,
CalendarSearchCache,
CommonViews,
ConversationSettings,
DefaultFoldersChangeHistory,
Expand All @@ -736,6 +743,7 @@ class WorkingSet(NonDeletableFolder):
OrganizationalContacts,
ParkedMessages,
PassThroughSearchResults,
PersonMetadata,
PdpProfileV2Secured,
Reminders,
RSSFeeds,
Expand Down
6 changes: 6 additions & 0 deletions tests/test_folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
BaseFolder,
Birthdays,
Calendar,
CalendarSearchCache,
CommonViews,
Companies,
Contacts,
Expand Down Expand Up @@ -69,6 +70,7 @@
PassThroughSearchResults,
PdpProfileV2Secured,
PeopleCentricConversationBuddies,
PersonMetadata,
PublicFoldersRoot,
QuickContacts,
RecipientCache,
Expand Down Expand Up @@ -593,6 +595,10 @@ def test_folder_grouping(self):
self.assertEqual(f.folder_class, "IPF.SkypeTeams.Message")
elif isinstance(f, SmsAndChatsSync):
self.assertEqual(f.folder_class, "IPF.SmsAndChatsSync")
elif isinstance(f, PersonMetadata):
self.assertEqual(f.folder_class, "IPF.Contact")
elif isinstance(f, CalendarSearchCache):
self.assertEqual(f.folder_class, "IPF.Appointment")
else:
self.assertIn(f.folder_class, (None, "IPF"), (f.name, f.__class__.__name__, f.folder_class))
self.assertIsInstance(f, Folder)
Expand Down

0 comments on commit ae3bff0

Please sign in to comment.