<s> from oslotest import base as test_base <EOL> from ironic_python_agent import encoding <EOL> class SerializableTesting ( encoding . Serializable ) : <EOL> serializable_fields = ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> def __init__ ( self , jack , jill ) : <EOL> self . jack = jack <EOL> self . jill = jill <EOL> class SerializableComparableTesting ( encoding . SerializableComparable ) : <EOL> serializable_fields = ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> def __init__ ( self , jack , jill ) : <EOL> self . jack = jack <EOL> self . jill = jill <EOL> class TestSerializable ( test_base . BaseTestCase ) : <EOL> def test_baseclass_serialize ( self ) : <EOL> obj = encoding . Serializable ( ) <EOL> self . assertEqual ( { } , obj . serialize ( ) ) <EOL> def test_childclass_serialize ( self ) : <EOL> expected = { '<STR_LIT>' : '<STR_LIT:hello>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> obj = SerializableTesting ( '<STR_LIT:hello>' , '<STR_LIT>' ) <EOL> self . assertEqual ( expected , obj . serialize ( ) ) <EOL> class TestSerializableComparable ( test_base . BaseTestCase ) : <EOL> def test_childclass_equal ( self ) : <EOL> obj1 = SerializableComparableTesting ( '<STR_LIT:hello>' , '<STR_LIT>' ) <EOL> obj2 = SerializableComparableTesting ( '<STR_LIT:hello>' , '<STR_LIT>' ) <EOL> self . assertEqual ( obj1 , obj2 ) <EOL> def test_childclass_notequal ( self ) : <EOL> obj1 = SerializableComparableTesting ( '<STR_LIT:hello>' , '<STR_LIT>' ) <EOL> obj2 = SerializableComparableTesting ( '<STR_LIT:hello>' , '<STR_LIT>' ) <EOL> self . assertNotEqual ( obj1 , obj2 ) <EOL> def test_childclass_hash ( self ) : <EOL> obj = SerializableComparableTesting ( '<STR_LIT:hello>' , '<STR_LIT>' ) <EOL> self . assertIsNone ( obj . __hash__ ) </s>
