<s> from stream_framework . feeds . aggregated_feed . redis import RedisAggregatedFeed <EOL> from stream_framework . tests . feeds . aggregated_feed . base import TestAggregatedFeed , implementation <EOL> from stream_framework . activity import AggregatedActivity <EOL> from stream_framework . tests . feeds . redis import CustomActivity <EOL> class CustomAggregated ( AggregatedActivity ) : <EOL> pass <EOL> class RedisCustomAggregatedFeed ( RedisAggregatedFeed ) : <EOL> activity_class = CustomActivity <EOL> aggregated_activity_class = CustomAggregated <EOL> class TestRedisAggregatedFeed ( TestAggregatedFeed ) : <EOL> feed_cls = RedisAggregatedFeed <EOL> class TestRedisCustomAggregatedFeed ( TestAggregatedFeed ) : <EOL> feed_cls = RedisCustomAggregatedFeed <EOL> activity_class = CustomActivity <EOL> aggregated_activity_class = CustomAggregated <EOL> @ implementation <EOL> def test_custom_activity ( self ) : <EOL> assert self . test_feed . count ( ) == <NUM_LIT:0> <EOL> self . feed_cls . insert_activity ( <EOL> self . activity <EOL> ) <EOL> self . test_feed . add ( self . activity ) <EOL> assert self . test_feed . count ( ) == <NUM_LIT:1> <EOL> aggregated = self . test_feed [ : <NUM_LIT:10> ] [ <NUM_LIT:0> ] <EOL> assert type ( aggregated ) == self . aggregated_activity_class <EOL> assert type ( aggregated . activities [ <NUM_LIT:0> ] ) == self . activity_class </s>
