def testExtraObjectAttribute(self):
    schedule = self.MakeLoaderAndLoad()
    # Add an attribute after AddRouteObject
    route_t = transitfeed.Route(short_name="T", route_type="Bus", route_id="t")
    schedule.AddRouteObject(route_t)
    route_t.t_foo = "foo"
    # Add an attribute before AddRouteObject
    route_n = transitfeed.Route(short_name="N", route_type="Bus", route_id="n")
    route_n.n_foo = "bar"
    schedule.AddRouteObject(route_n)
    saved_schedule_file = StringIO()
    schedule.WriteGoogleTransitFeed(saved_schedule_file)
    self.accumulator.AssertNoMoreExceptions()

    self.assertLoadAndCheckExtraValues(saved_schedule_file)
Extra columns added to an object are preserved when writing.
dataset/ETHPy150Open google/transitfeed/tests/transitfeed/testroute.py/RouteMemoryZipTestCase.testExtraObjectAttribute