def test_returns_coputation(self): proto = computation_factory.create_lambda_empty_struct() self.assertIsInstance(proto, pb.Computation) actual_type = type_serialization.deserialize_type(proto.type) expected_type = computation_types.FunctionType( None, computation_types.StructType(())) self.assertEqual(actual_type, expected_type)
def create_dummy_computation_lambda_empty(): """Returns a lambda computation and type `( -> <>)`.""" value = computation_factory.create_lambda_empty_struct() type_signature = computation_types.FunctionType(None, []) return value, type_signature