You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
deftest_set_finding_state_flattened():
client=SecurityCenterClient(credentials=credentials.AnonymousCredentials(),)
# Mock the actual call within the gRPC stub, and fake the request.withmock.patch.object(
type(client._transport.set_finding_state), "__call__"
) ascall:
# Designate an appropriate return value for the call.call.return_value=finding.Finding()
# Call the method with a truthy value for each flattened field,# using the keyword arguments to the method.client.set_finding_state(
name="name_value",
state=finding.Finding.State.ACTIVE,
start_time=timestamp.Timestamp(seconds=751),
)
# Establish that the underlying call was made with the expected# request object values.assertlen(call.mock_calls) ==1_, args, _=call.mock_calls[0]
assertargs[0].name=="name_value"assertargs[0].state==finding.Finding.State.ACTIVEassertargs[0].start_time==timestamp.Timestamp(seconds=751)
args[0].start_time is a Python datetime object and the assert fails.
The text was updated successfully, but these errors were encountered:
args[0].start_time
is a Python datetime object and the assert fails.The text was updated successfully, but these errors were encountered: