Пример #1
0
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'
Пример #2
0
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"
Пример #3
0
    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
Пример #4
0
    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
Пример #5
0
    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
Пример #6
0
    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
Пример #7
0
    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
Пример #8
0
    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
Пример #9
0
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'
Пример #10
0
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'