<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from . . service import VolumeName <EOL> from . . testtools import create_realistic_servicepair <EOL> from ... testtools import AsyncTestCase , flaky <EOL> class RealisticTests ( AsyncTestCase ) : <EOL> """<STR_LIT>""" <EOL> @ flaky ( u'<STR_LIT>' ) <EOL> def test_handoff ( self ) : <EOL> """<STR_LIT>""" <EOL> service_pair = create_realistic_servicepair ( self ) <EOL> d = service_pair . from_service . create ( <EOL> service_pair . from_service . get ( <EOL> VolumeName ( namespace = u"<STR_LIT>" , dataset_id = u"<STR_LIT>" ) <EOL> ) <EOL> ) <EOL> def created ( volume ) : <EOL> return service_pair . from_service . handoff ( <EOL> volume , service_pair . remote ) <EOL> d . addCallback ( created ) <EOL> return d <EOL> def test_handoff_roundtrip ( self ) : <EOL> """<STR_LIT>""" <EOL> service_pair = create_realistic_servicepair ( self ) <EOL> d = service_pair . from_service . create ( <EOL> service_pair . from_service . get ( <EOL> VolumeName ( namespace = u"<STR_LIT>" , dataset_id = u"<STR_LIT>" ) <EOL> ) <EOL> ) <EOL> def created ( volume ) : <EOL> return service_pair . from_service . handoff ( <EOL> volume , service_pair . remote ) <EOL> d . addCallback ( created ) <EOL> def handed_off ( _ ) : <EOL> return service_pair . to_service . handoff ( <EOL> service_pair . to_service . get ( <EOL> VolumeName ( namespace = u"<STR_LIT>" , dataset_id = u"<STR_LIT>" ) ) , <EOL> service_pair . origin_remote ) <EOL> return d </s>
