File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,11 @@ def hello_rtdb(data, context):
38
38
"""
39
39
trigger_resource = context .resource
40
40
41
+ if 'params' in data :
42
+ print ('Path parameters:' )
43
+ for param , value in data ['params' ].items ():
44
+ print (f' { param } : { value } ' )
45
+
41
46
print ('Function triggered by change to: %s' % trigger_resource )
42
47
print ('Admin?: %s' % data .get ("admin" , False ))
43
48
print ('Delta:' )
Original file line number Diff line number Diff line change @@ -29,7 +29,8 @@ class Context(object):
29
29
def test_rtdb (capsys ):
30
30
data = {
31
31
'admin' : True ,
32
- 'delta' : {'id' : 'my-data' }
32
+ 'delta' : {'id' : 'my-data' },
33
+ 'params' : {'baz' : 'quux' }
33
34
}
34
35
35
36
context = Context ()
@@ -39,6 +40,7 @@ def test_rtdb(capsys):
39
40
40
41
out , _ = capsys .readouterr ()
41
42
43
+ assert 'baz: quux' in out
42
44
assert 'Function triggered by change to: my-resource' in out
43
45
assert 'Admin?: True' in out
44
46
assert 'my-data' in out
You can’t perform that action at this time.
0 commit comments