<s> from neutron . api . rpc . callbacks import resources <EOL> from neutron . objects . qos import policy <EOL> from neutron . tests import base <EOL> class GetResourceTypeTestCase ( base . BaseTestCase ) : <EOL> def test_get_resource_type_none ( self ) : <EOL> self . assertIsNone ( resources . get_resource_type ( None ) ) <EOL> def test_get_resource_type_wrong_type ( self ) : <EOL> self . assertIsNone ( resources . get_resource_type ( object ( ) ) ) <EOL> def test_get_resource_type ( self ) : <EOL> self . assertEqual ( policy . QosPolicy . obj_name ( ) , <EOL> resources . get_resource_type ( policy . QosPolicy ( ) ) ) <EOL> class IsValidResourceTypeTestCase ( base . BaseTestCase ) : <EOL> def test_known_type ( self ) : <EOL> self . assertTrue ( resources . is_valid_resource_type ( <EOL> policy . QosPolicy . obj_name ( ) ) ) <EOL> def test_unknown_type ( self ) : <EOL> self . assertFalse ( <EOL> resources . is_valid_resource_type ( '<STR_LIT>' ) ) <EOL> class GetResourceClsTestCase ( base . BaseTestCase ) : <EOL> def test_known_type ( self ) : <EOL> self . assertEqual ( policy . QosPolicy , <EOL> resources . get_resource_cls ( resources . QOS_POLICY ) ) <EOL> def test_unknown_type ( self ) : <EOL> self . assertIsNone ( resources . get_resource_cls ( '<STR_LIT>' ) ) </s>
