<s> def test_RosdepDatabaseEntry ( ) : <EOL> from rosdep2 . model import RosdepDatabaseEntry <EOL> d = RosdepDatabaseEntry ( { '<STR_LIT:a>' : <NUM_LIT:1> } , [ ] , '<STR_LIT:foo>' ) <EOL> assert d . rosdep_data == { '<STR_LIT:a>' : <NUM_LIT:1> } <EOL> assert d . view_dependencies == [ ] <EOL> assert d . origin == '<STR_LIT:foo>' <EOL> def test_RosdepDatabase ( ) : <EOL> from rosdep2 . model import RosdepDatabase <EOL> db = RosdepDatabase ( ) <EOL> assert not db . is_loaded ( '<STR_LIT:foo>' ) <EOL> data = { '<STR_LIT:a>' : <NUM_LIT:1> } <EOL> db . set_view_data ( '<STR_LIT:foo>' , data , [ ] , '<STR_LIT>' ) <EOL> assert db . is_loaded ( '<STR_LIT:foo>' ) <EOL> entry = db . get_view_data ( '<STR_LIT:foo>' ) <EOL> assert entry . rosdep_data == data <EOL> assert entry . origin == '<STR_LIT>' <EOL> assert entry . view_dependencies == [ ] <EOL> data [ '<STR_LIT:a>' ] = <NUM_LIT:2> <EOL> assert entry . rosdep_data != data <EOL> data = { '<STR_LIT:b>' : <NUM_LIT:2> } <EOL> db . set_view_data ( '<STR_LIT:bar>' , data , [ '<STR_LIT:foo>' ] , '<STR_LIT>' ) <EOL> assert db . is_loaded ( '<STR_LIT:bar>' ) <EOL> entry = db . get_view_data ( '<STR_LIT:bar>' ) <EOL> assert entry . rosdep_data == data <EOL> assert entry . origin == '<STR_LIT>' <EOL> assert entry . view_dependencies == [ '<STR_LIT:foo>' ] <EOL> data = { '<STR_LIT:b>' : <NUM_LIT:3> } <EOL> assert db . is_loaded ( '<STR_LIT:bar>' ) <EOL> db . set_view_data ( '<STR_LIT:bar>' , data , [ '<STR_LIT>' , '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> assert db . is_loaded ( '<STR_LIT:bar>' ) <EOL> entry = db . get_view_data ( '<STR_LIT:bar>' ) <EOL> assert entry . rosdep_data == data <EOL> assert entry . origin == '<STR_LIT>' <EOL> assert set ( entry . view_dependencies ) == set ( [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> def test_RosdepDatabase_get_view_dependencies ( ) : <EOL> from rosdep2 . model import RosdepDatabase <EOL> data = { '<STR_LIT:a>' : <NUM_LIT:1> } <EOL> db = RosdepDatabase ( ) <EOL> db . set_view_data ( '<STR_LIT:foo>' , data , [ ] , '<STR_LIT>' ) <EOL> assert [ ] == db . get_view_dependencies ( '<STR_LIT:foo>' ) <EOL> db . set_view_data ( '<STR_LIT:bar>' , data , [ '<STR_LIT:foo>' ] , '<STR_LIT>' ) <EOL> assert [ '<STR_LIT:foo>' ] == db . get_view_dependencies ( '<STR_LIT:bar>' ) <EOL> db . set_view_data ( '<STR_LIT>' , data , [ '<STR_LIT:bar>' ] , '<STR_LIT>' ) <EOL> assert [ '<STR_LIT:foo>' , '<STR_LIT:bar>' ] == db . get_view_dependencies ( '<STR_LIT>' ) <EOL> db . set_view_data ( '<STR_LIT>' , data , [ ] , '<STR_LIT>' ) <EOL> db . set_view_data ( '<STR_LIT>' , data , [ '<STR_LIT>' , '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> retval = db . get_view_dependencies ( '<STR_LIT>' ) <EOL> assert set ( [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:foo>' , '<STR_LIT:bar>' ] ) == set ( retval ) , retval <EOL> assert len ( retval ) == <NUM_LIT:4> </s>
