• Home
  • Raw
  • Download

Lines Matching refs:creds

76         creds = credentials.Credentials(
88 assert creds.refresh_handler is original_refresh_handler
90 creds.refresh_handler = updated_refresh_handler
92 assert creds.refresh_handler is updated_refresh_handler
94 creds.refresh_handler = None
96 assert creds.refresh_handler is None
202 creds = credentials.Credentials(
213 creds.refresh(request)
228 assert creds.token == token
229 assert creds.expiry == expiry
230 assert creds.id_token == mock.sentinel.id_token
231 assert creds.rapt_token == new_rapt_token
235 assert creds.valid
248 creds = credentials.Credentials(
260 creds.refresh(request)
262 assert creds.token == "ACCESS_TOKEN"
263 assert creds.expiry == expected_expiry
264 assert creds.valid
265 assert not creds.expired
278 creds = credentials.Credentials(
291 creds.refresh_handler = refresh_handler
292 creds.refresh(request)
294 assert creds.token == "ACCESS_TOKEN"
295 assert creds.expiry == expected_expiry
296 assert creds.valid
297 assert not creds.expired
310 creds = credentials.Credentials(
325 creds.refresh(request)
327 assert creds.token is None
328 assert creds.expiry is None
329 assert not creds.valid
339 creds = credentials.Credentials(
354 creds.refresh(request)
356 assert creds.token is None
357 assert creds.expiry is None
358 assert not creds.valid
370 creds = credentials.Credentials(
383 creds.refresh(request)
385 assert creds.token is None
386 assert creds.expiry is None
387 assert not creds.valid
419 creds = credentials.Credentials(
432 creds.refresh(request)
447 assert creds.token == token
448 assert creds.expiry == expiry
449 assert creds.id_token == mock.sentinel.id_token
450 assert creds.has_scopes(scopes)
451 assert creds.rapt_token == new_rapt_token
455 assert creds.valid
484 creds = credentials.Credentials(
496 creds.refresh(request)
511 assert creds.token == token
512 assert creds.expiry == expiry
513 assert creds.id_token == mock.sentinel.id_token
514 assert creds.has_scopes(default_scopes)
515 assert creds.rapt_token == new_rapt_token
519 assert creds.valid
551 creds = credentials.Credentials(
563 creds.refresh(request)
578 assert creds.token == token
579 assert creds.expiry == expiry
580 assert creds.id_token == mock.sentinel.id_token
581 assert creds.has_scopes(scopes)
582 assert creds.rapt_token == new_rapt_token
586 assert creds.valid
619 creds = credentials.Credentials(
634 creds.refresh(request)
649 assert creds.token == token
650 assert creds.expiry == expiry
651 assert creds.id_token == mock.sentinel.id_token
652 assert creds.has_scopes(scopes)
653 assert creds.rapt_token == new_rapt_token
657 assert creds.valid
660 creds = credentials.Credentials(
670 creds.apply(headers)
675 creds = credentials.Credentials(
684 creds.apply(headers)
689 creds = credentials.Credentials(
698 new_creds = creds.with_quota_project("new-project-456")
701 creds.apply(headers)
707 creds = credentials.Credentials.from_authorized_user_info(info)
708 assert creds.client_secret == info["client_secret"]
709 assert creds.client_id == info["client_id"]
710 assert creds.refresh_token == info["refresh_token"]
711 assert creds.token_uri == credentials._GOOGLE_OAUTH2_TOKEN_ENDPOINT
712 assert creds.scopes is None
715 creds = credentials.Credentials.from_authorized_user_info(info, scopes)
716 assert creds.client_secret == info["client_secret"]
717 assert creds.client_id == info["client_id"]
718 assert creds.refresh_token == info["refresh_token"]
719 assert creds.token_uri == credentials._GOOGLE_OAUTH2_TOKEN_ENDPOINT
720 assert creds.scopes == scopes
723 creds = credentials.Credentials.from_authorized_user_info(info)
724 assert creds.scopes == [info["scopes"]]
727 creds = credentials.Credentials.from_authorized_user_info(info)
728 assert creds.scopes == info["scopes"]
732 creds = credentials.Credentials.from_authorized_user_info(info)
733 assert creds.expiry == expiry
734 assert creds.expired
739 creds = credentials.Credentials.from_authorized_user_file(AUTH_USER_JSON_FILE)
740 assert creds.client_secret == info["client_secret"]
741 assert creds.client_id == info["client_id"]
742 assert creds.refresh_token == info["refresh_token"]
743 assert creds.token_uri == credentials._GOOGLE_OAUTH2_TOKEN_ENDPOINT
744 assert creds.scopes is None
745 assert creds.rapt_token is None
748 creds = credentials.Credentials.from_authorized_user_file(
751 assert creds.client_secret == info["client_secret"]
752 assert creds.client_id == info["client_id"]
753 assert creds.refresh_token == info["refresh_token"]
754 assert creds.token_uri == credentials._GOOGLE_OAUTH2_TOKEN_ENDPOINT
755 assert creds.scopes == scopes
761 creds = credentials.Credentials.from_authorized_user_file(file_path)
762 assert creds.client_secret == info["client_secret"]
763 assert creds.client_id == info["client_id"]
764 assert creds.refresh_token == info["refresh_token"]
765 assert creds.token_uri == credentials._GOOGLE_OAUTH2_TOKEN_ENDPOINT
766 assert creds.scopes is None
767 assert creds.rapt_token == "rapt"
773 creds = credentials.Credentials.from_authorized_user_info(info)
774 assert creds.expiry == expiry
777 json_output = creds.to_json()
779 assert json_asdict.get("token") == creds.token
780 assert json_asdict.get("refresh_token") == creds.refresh_token
781 assert json_asdict.get("token_uri") == creds.token_uri
782 assert json_asdict.get("client_id") == creds.client_id
783 assert json_asdict.get("scopes") == creds.scopes
784 assert json_asdict.get("client_secret") == creds.client_secret
788 json_output = creds.to_json(strip=["client_secret"])
790 assert json_asdict.get("token") == creds.token
791 assert json_asdict.get("refresh_token") == creds.refresh_token
792 assert json_asdict.get("token_uri") == creds.token_uri
793 assert json_asdict.get("client_id") == creds.client_id
794 assert json_asdict.get("scopes") == creds.scopes
798 creds.expiry = None
799 json_output = creds.to_json()
804 creds = self.make_credentials()
805 unpickled = pickle.loads(pickle.dumps(creds))
808 assert list(creds.__dict__).sort() == list(unpickled.__dict__).sort()
810 for attr in list(creds.__dict__):
811 assert getattr(creds, attr) == getattr(unpickled, attr)
817 creds = credentials.Credentials(
826 unpickled = pickle.loads(pickle.dumps(creds))
829 assert list(creds.__dict__).sort() == list(unpickled.__dict__).sort()
831 for attr in list(creds.__dict__):
837 assert getattr(creds, attr) == getattr(unpickled, attr)
840 creds = self.make_credentials()
845 del creds.__dict__["_quota_project_id"]
847 unpickled = pickle.loads(pickle.dumps(creds))