File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 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):
3838 """
3939 trigger_resource = context .resource
4040
41+ if 'params' in data :
42+ print ('Path parameters:' )
43+ for param , value in data ['params' ].items ():
44+ print (f' { param } : { value } ' )
45+
4146 print ('Function triggered by change to: %s' % trigger_resource )
4247 print ('Admin?: %s' % data .get ("admin" , False ))
4348 print ('Delta:' )
Original file line number Diff line number Diff line change @@ -29,7 +29,8 @@ class Context(object):
2929def test_rtdb (capsys ):
3030 data = {
3131 'admin' : True ,
32- 'delta' : {'id' : 'my-data' }
32+ 'delta' : {'id' : 'my-data' },
33+ 'params' : {'baz' : 'quux' }
3334 }
3435
3536 context = Context ()
@@ -39,6 +40,7 @@ def test_rtdb(capsys):
3940
4041 out , _ = capsys .readouterr ()
4142
43+ assert 'baz: quux' in out
4244 assert 'Function triggered by change to: my-resource' in out
4345 assert 'Admin?: True' in out
4446 assert 'my-data' in out
You can’t perform that action at this time.
0 commit comments