def login(username=None, password=None): """A shortcut for user login. Create a :class:`.Geocaching` instance and try to login a user. See :meth:`.Geocaching.login`. :return: Created :class:`.Geocaching` instance. """ g = Geocaching() g.login(username, password) return g
def login_with_token(token=None): """A shortcut for user login. Create a :class:`.Geocaching` instance and try to login a user. See :meth:`.Geocaching.login`. :return: Created :class:`.Geocaching` instance. """ g = Geocaching() g.login_with_token(token) return g
def setUp(self): self.gc = Geocaching() self.c = Cache(self.gc, "GC12345", name="Testing", type=Type.traditional, location=Point(), state=True, found=False, size=Size.micro, difficulty=1.5, terrain=5, author="human", hidden=date(2000, 1, 1), attributes={ "onehour": True, "kids": False, "available": True }, summary="text", description="long text", hint="rot13", favorites=0, pm_only=False, original_location=Point(), waypoints={}, guid="53d34c4d-12b5-4771-86d3-89318f71efb1") self.c._log_page_url = "/seek/log.aspx?ID=1234567&lcn=1"
def setUpClass(cls): cls.gc = Geocaching(session=session) try: cls.gc.login(username, password) except Error: # LoginFailedException is raised with invalid creds; Error is raised # with no network connection. This is okay as long as we aren't # recording new cassettes. If we are recording new cassettes, they # will indeed fail. But we shouldn't record and replay setup login, # because if we are recording new cassettes this means we cannot get # properly logged in. cls.gc._logged_in = True # we're gonna trick it cls.gc._session = session # it got redefined; fix it
def setUpClass(cls): cls.gc = Geocaching() cls.gc.login(_username, _password) cls.c = Cache(cls.gc, "GC1PAR2") cls.c.load()
def geocaching_logged_in(betamax_session: requests.Session): gc = Geocaching(session=betamax_session) gc.login(USERNAME, PASSWORD) return gc
def geocaching(betamax_session: requests.Session): return Geocaching(session=betamax_session)
def login(username, password): """Logs the user in. A shortcut for Geocaching().login().""" g = Geocaching() g.login(username, password) return g
def setUpClass(cls): cls.session = Session() cls.recorder = Betamax(cls.session, default_cassette_options={"serialize_with": "prettyjson"}) cls.gc = Geocaching(session=cls.session)