<s> from solum . objects import registry <EOL> from solum . objects . sqlalchemy import operation <EOL> from solum . tests import base <EOL> from solum . tests import utils <EOL> class TestOperation ( base . BaseTestCase ) : <EOL> def setUp ( self ) : <EOL> super ( TestOperation , self ) . setUp ( ) <EOL> self . db = self . useFixture ( utils . Database ( ) ) <EOL> self . ctx = utils . dummy_context ( ) <EOL> self . data = [ { '<STR_LIT>' : self . ctx . tenant , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT:name>' : '<STR_LIT>' , <EOL> '<STR_LIT:description>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } ] <EOL> utils . create_models_from_data ( operation . Operation , self . data , self . ctx ) <EOL> def test_objects_registered ( self ) : <EOL> self . assertIsNotNone ( registry . Operation ) <EOL> self . assertIsNotNone ( registry . OperationList ) <EOL> def test_get_all ( self ) : <EOL> lst = operation . OperationList ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( lst . get_all ( self . ctx ) ) ) <EOL> def test_check_data ( self ) : <EOL> pl = operation . Operation ( ) . get_by_id ( self . ctx , self . data [ <NUM_LIT:0> ] [ '<STR_LIT:id>' ] ) <EOL> for key , value in self . data [ <NUM_LIT:0> ] . items ( ) : <EOL> self . assertEqual ( value , getattr ( pl , key ) ) </s>
