<s> import pickle <EOL> from nose . tools import eq_ <EOL> from . . import aggregators <EOL> from ... . datasources import Datasource <EOL> from ... . dependencies import solve <EOL> def test_sum ( ) : <EOL> my_list = Datasource ( "<STR_LIT>" ) <EOL> my_sum = aggregators . sum ( my_list ) <EOL> cache = { my_list : [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> ] } <EOL> eq_ ( solve ( my_sum , cache = cache ) , <NUM_LIT:10> ) <EOL> cache = { my_list : [ ] } <EOL> eq_ ( solve ( my_sum , cache = cache ) , <NUM_LIT:0> ) <EOL> cache = { my_list : None } <EOL> eq_ ( solve ( my_sum , cache = cache ) , <NUM_LIT:0> ) <EOL> eq_ ( pickle . loads ( pickle . dumps ( my_sum ) ) , my_sum ) <EOL> def test_min ( ) : <EOL> my_list = Datasource ( "<STR_LIT>" ) <EOL> my_min = aggregators . min ( my_list ) <EOL> cache = { my_list : [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> ] } <EOL> eq_ ( solve ( my_min , cache = cache ) , <NUM_LIT:1> ) <EOL> cache = { my_list : [ ] } <EOL> eq_ ( solve ( my_min , cache = cache ) , <NUM_LIT:0> ) <EOL> cache = { my_list : None } <EOL> eq_ ( solve ( my_min , cache = cache ) , <NUM_LIT:0> ) <EOL> eq_ ( pickle . loads ( pickle . dumps ( my_min ) ) , my_min ) <EOL> def test_max ( ) : <EOL> my_list = Datasource ( "<STR_LIT>" ) <EOL> my_max = aggregators . max ( my_list ) <EOL> cache = { my_list : [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> ] } <EOL> eq_ ( solve ( my_max , cache = cache ) , <NUM_LIT:4> ) <EOL> cache = { my_list : [ ] } <EOL> eq_ ( solve ( my_max , cache = cache ) , <NUM_LIT:0> ) <EOL> cache = { my_list : None } <EOL> eq_ ( solve ( my_max , cache = cache ) , <NUM_LIT:0> ) <EOL> eq_ ( pickle . loads ( pickle . dumps ( my_max ) ) , my_max ) <EOL> def test_len ( ) : <EOL> my_list = Datasource ( "<STR_LIT>" ) <EOL> my_len = aggregators . len ( my_list ) <EOL> cache = { my_list : [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> ] } <EOL> eq_ ( solve ( my_len , cache = cache ) , <NUM_LIT:4> ) <EOL> cache = { my_list : [ ] } <EOL> eq_ ( solve ( my_len , cache = cache ) , <NUM_LIT:0> ) <EOL> cache = { my_list : None } <EOL> eq_ ( solve ( my_len , cache = cache ) , <NUM_LIT:0> ) <EOL> eq_ ( pickle . loads ( pickle . dumps ( my_len ) ) , my_len ) </s>
