def test_fs_folder_path(): assert fs_folder_path('INBOX.A.B') == 'INBOX/A/B' assert fs_folder_path('INBOX.A.B', prefix='INBOX.') == 'A/B' assert fs_folder_path('INBOX?A?B', prefix='INBOX?', separator='?') == 'A/B' assert fs_folder_path( 'INBOX.a.very.deep.nested.folder') == 'INBOX/a/very/deep/nested/folder' assert fs_folder_path(imap_folder_path('a/b')) == 'a/b'
def test_fs_folder_path(): assert fs_folder_path("INBOX.A.B") == "INBOX/A/B" assert fs_folder_path("INBOX.A.B", prefix="INBOX.") == "A/B" assert fs_folder_path("INBOX?A?B", prefix="INBOX?", separator="?") == "A/B" assert (fs_folder_path("INBOX.a.very.deep.nested.folder") == "INBOX/a/very/deep/nested/folder") assert fs_folder_path(imap_folder_path("a/b")) == "a/b"
def api_display_name(self): if self.namespace.account.provider == 'gmail' and \ self.display_name.startswith('[Gmail]/'): return self.display_name[8:] if self.namespace.account.provider in ['generic', 'fastmail'] and \ is_imap_folder_path(self.display_name): return fs_folder_path(self.display_name) return self.display_name
def api_display_name(self): if self.namespace.account.provider == "gmail": if self.display_name.startswith("[Gmail]/"): return self.display_name[8:] elif self.display_name.startswith("[Google Mail]/"): return self.display_name[14:] if self.namespace.account.provider in ["generic", "fastmail"] and is_imap_folder_path(self.display_name): return fs_folder_path(self.display_name) return self.display_name
def api_display_name(self): if self.namespace.account.provider == 'gmail': if self.display_name.startswith('[Gmail]/'): return self.display_name[8:] elif self.display_name.startswith('[Google Mail]/'): return self.display_name[14:] if self.namespace.account.provider not in ['gmail', 'eas']: return fs_folder_path(self.display_name, separator=self.namespace.account.folder_separator, prefix=self.namespace.account.folder_prefix) return self.display_name
def api_display_name(self): if self.namespace.account.provider == 'gmail': if self.display_name.startswith('[Gmail]/'): return self.display_name[8:] elif self.display_name.startswith('[Google Mail]/'): return self.display_name[14:] if self.namespace.account.provider not in ['gmail', 'eas']: return fs_folder_path( self.display_name, separator=self.namespace.account.folder_separator, prefix=self.namespace.account.folder_prefix) return self.display_name
def api_display_name(self): if self.namespace.account.provider == "gmail": if self.display_name.startswith("[Gmail]/"): return self.display_name[8:] elif self.display_name.startswith("[Google Mail]/"): return self.display_name[14:] if self.namespace.account.provider not in ["gmail", "microsoft"]: return fs_folder_path( self.display_name, separator=self.namespace.account.folder_separator, prefix=self.namespace.account.folder_prefix, ) return self.display_name
def test_fs_folder_path(): assert fs_folder_path('INBOX.A.B') == 'A/B' assert fs_folder_path('INBOX.a.very.deep.nested.folder') == 'a/very/deep/nested/folder' assert fs_folder_path(imap_folder_path('/a/b')) == 'a/b'
def test_fs_folder_path(): assert fs_folder_path('INBOX.A.B') == 'INBOX/A/B' assert fs_folder_path('INBOX.A.B', prefix='INBOX.') == 'A/B' assert fs_folder_path('INBOX?A?B', prefix='INBOX?', separator='?') == 'A/B' assert fs_folder_path('INBOX.a.very.deep.nested.folder') == 'INBOX/a/very/deep/nested/folder' assert fs_folder_path(imap_folder_path('a/b')) == 'a/b'