<s> import mock <EOL> from rally . plugins . openstack . scenarios . ceilometer import stats <EOL> from tests . unit import test <EOL> class CeilometerStatsTestCase ( test . ScenarioTestCase ) : <EOL> def test_get_stats ( self ) : <EOL> scenario = stats . CeilometerStats ( self . context ) <EOL> scenario . _get_stats = mock . MagicMock ( ) <EOL> context = { "<STR_LIT:user>" : { "<STR_LIT>" : "<STR_LIT>" , "<STR_LIT:id>" : "<STR_LIT>" } , <EOL> "<STR_LIT>" : { "<STR_LIT:id>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : [ "<STR_LIT>" ] } } <EOL> metadata_query = { "<STR_LIT:a>" : "<STR_LIT:test>" } <EOL> period = <NUM_LIT:10> <EOL> groupby = "<STR_LIT>" <EOL> aggregates = "<STR_LIT>" <EOL> scenario . context = context <EOL> scenario . get_stats ( "<STR_LIT>" , True , True , True , metadata_query , <EOL> period , groupby , aggregates ) <EOL> scenario . _get_stats . assert_called_once_with ( <EOL> "<STR_LIT>" , <EOL> [ { "<STR_LIT>" : "<STR_LIT>" , "<STR_LIT:value>" : "<STR_LIT>" , "<STR_LIT>" : "<STR_LIT>" } , <EOL> { "<STR_LIT>" : "<STR_LIT>" , "<STR_LIT:value>" : "<STR_LIT>" , "<STR_LIT>" : "<STR_LIT>" } , <EOL> { "<STR_LIT>" : "<STR_LIT>" , "<STR_LIT:value>" : "<STR_LIT>" , "<STR_LIT>" : "<STR_LIT>" } , <EOL> { "<STR_LIT>" : "<STR_LIT>" , "<STR_LIT:value>" : "<STR_LIT:test>" , "<STR_LIT>" : "<STR_LIT>" } ] , <EOL> <NUM_LIT:10> , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> ) </s>
