def test_remote_user_from_proto_fail(): with pytest.raises(IncorrectTypeError) as err_info: RemoteUser.from_proto('') assert err_info.value.message == ( "RemoteUser's parameter 'user' was" " type 'str' but should be of class 'dlpx.virtualization.api" ".common_pb2.RemoteUser'.")
def test_remote_user_from_proto_success(): remote_user_proto_buf = common_pb2.RemoteUser() remote_user = RemoteUser.from_proto(remote_user_proto_buf) assert isinstance(remote_user, RemoteUser)