FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
powertools-lambda-python/tests/functional/utils.py at develop · aws-powertools/powertools-lambda-python · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
aws-powertools
/
powertools-lambda-python
Public
Notifications
You must be signed in to change notification settings
Fork
492
Star
3.3k
Code
Issues
33
Pull requests
10
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
powertools-lambda-python
/
tests
/
functional
/
utils.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
23 lines (14 loc) · 569 Bytes
Breadcrumbs
powertools-lambda-python
/
tests
/
functional
/
utils.py
Copy path
File metadata and controls
23 lines (14 loc) · 569 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import
base64
import
json
from
pathlib
import
Path
from
typing
import
Any
from
aws_lambda_powertools
.
shared
.
json_encoder
import
Encoder
def
load_event
(
file_name
:
str
)
->
Any
:
path
=
Path
(
str
(
Path
(
__file__
).
parent
.
parent
)
+
"/events/"
+
file_name
)
return
json
.
loads
(
path
.
read_text
())
def
str_to_b64
(
data
:
str
)
->
str
:
return
base64
.
b64encode
(
data
.
encode
()).
decode
(
"utf-8"
)
def
b64_to_str
(
data
:
str
)
->
str
:
return
base64
.
b64decode
(
data
.
encode
()).
decode
(
"utf-8"
)
def
json_serialize
(
data
):
return
json
.
dumps
(
data
,
sort_keys
=
True
,
cls
=
Encoder
)
Back
|
FazBrowse Home
|
New Git URL