• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

box / box-python-sdk / 7583613459

19 Jan 2024 12:14PM UTC coverage: 93.536% (+0.005%) from 93.531%
7583613459

push

github

web-flow
fix: Update exception file get download URL (#866)

* fix: Update exception file get download URL

* fix: Update exception file get download URL

3 of 3 new or added lines in 1 file covered. (100.0%)

3473 of 3713 relevant lines covered (93.54%)

1.87 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

71.43
/boxsdk/object/cloneable.py
1
from typing import TYPE_CHECKING, NoReturn
2✔
2

3
if TYPE_CHECKING:
2✔
4
    from boxsdk.object.user import User
×
5
    from boxsdk.session.session import Session
×
6

7

8
class Cloneable:
2✔
9
    """
10
    Cloneable interface to be implemented by endpoint objects that should have ability to be cloned, but with a
11
    different session member if desired.
12
    """
13

14
    def as_user(self, user: 'User') -> 'Cloneable':
2✔
15
        """
16
        Returns a new endpoint object with default headers set up to make requests as the specified user.
17

18
        :param user:
19
            The user to impersonate when making API requests.
20
        """
21
        return self.clone(self.session.as_user(user))
2✔
22

23
    def with_shared_link(self, shared_link: str, shared_link_password: str) -> 'Cloneable':
2✔
24
        """
25
        Returns a new endpoint object with default headers set up to make requests using the shared link for auth.
26

27
        :param shared_link:
28
            The shared link.
29
        :param shared_link_password:
30
            The password for the shared link.
31
        """
32
        return self.clone(self.session.with_shared_link(shared_link, shared_link_password))
2✔
33

34
    def clone(self, session: 'Session' = None) -> NoReturn:
2✔
35
        """
36
        Returns a copy of this cloneable object using the specified session.
37

38
        :param session:
39
            The Box session used to make requests.
40
        """
41
        raise NotImplementedError
×
42

43
    @property
2✔
44
    def session(self) -> NoReturn:
2✔
45
        """
46
        Return the Box session being used to make requests.
47
        """
48
        raise NotImplementedError
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc