<s> """<STR_LIT>""" <EOL> import unittest <EOL> from google . cloud . dataflow . internal import apiclient <EOL> from google . cloud . dataflow . io import iobase <EOL> import google . cloud . dataflow . internal . clients . dataflow as dataflow <EOL> class UtilTest ( unittest . TestCase ) : <EOL> def test_reader_progress_to_cloud_progress_position ( self ) : <EOL> reader_position = iobase . ReaderPosition ( byte_offset = <NUM_LIT> ) <EOL> reader_progress = iobase . ReaderProgress ( position = reader_position ) <EOL> cloud_progress = apiclient . reader_progress_to_cloud_progress ( <EOL> reader_progress ) <EOL> self . assertIsNotNone ( cloud_progress ) <EOL> self . assertIsInstance ( cloud_progress , dataflow . ApproximateProgress ) <EOL> self . assertIsNotNone ( cloud_progress . position ) <EOL> self . assertIsInstance ( cloud_progress . position , dataflow . Position ) <EOL> self . assertEquals ( <NUM_LIT> , cloud_progress . position . byteOffset ) <EOL> def test_reader_progress_to_cloud_progress_percent_complete ( self ) : <EOL> reader_progress = iobase . ReaderProgress ( percent_complete = <NUM_LIT> ) <EOL> cloud_progress = apiclient . reader_progress_to_cloud_progress ( <EOL> reader_progress ) <EOL> self . assertIsNotNone ( cloud_progress ) <EOL> self . assertIsInstance ( cloud_progress , dataflow . ApproximateProgress ) <EOL> self . assertIsNotNone ( cloud_progress . percentComplete ) <EOL> self . assertEquals ( <NUM_LIT> , cloud_progress . percentComplete ) <EOL> def test_reader_position_to_cloud_position ( self ) : <EOL> reader_position = iobase . ReaderPosition ( byte_offset = <NUM_LIT> ) <EOL> cloud_position = apiclient . reader_position_to_cloud_position ( <EOL> reader_position ) <EOL> self . assertIsNotNone ( cloud_position ) <EOL> def test_dynamic_split_result_with_position_to_cloud_stop_position ( self ) : <EOL> position = iobase . ReaderPosition ( byte_offset = <NUM_LIT> ) <EOL> dynamic_split_result = iobase . DynamicSplitResultWithPosition ( position ) <EOL> approximate_position = ( <EOL> apiclient . dynamic_split_result_with_position_to_cloud_stop_position ( <EOL> dynamic_split_result ) ) <EOL> self . assertIsNotNone ( approximate_position ) <EOL> self . assertIsInstance ( approximate_position , dataflow . Position ) <EOL> self . assertEqual ( <NUM_LIT> , approximate_position . byteOffset ) <EOL> def test_cloud_progress_to_reader_progress_index_position ( self ) : <EOL> cloud_progress = dataflow . ApproximateProgress ( ) <EOL> cloud_progress . position = dataflow . Position ( ) <EOL> cloud_progress . position . byteOffset = <NUM_LIT> <EOL> reader_progress = apiclient . cloud_progress_to_reader_progress ( <EOL> cloud_progress ) <EOL> self . assertIsNotNone ( reader_progress . position ) <EOL> self . assertIsInstance ( reader_progress . position , iobase . ReaderPosition ) <EOL> self . assertEqual ( <NUM_LIT> , reader_progress . position . byte_offset ) <EOL> def test_cloud_progress_to_reader_progress_percent_complete ( self ) : <EOL> cloud_progress = dataflow . ApproximateProgress ( ) <EOL> cloud_progress . percentComplete = <NUM_LIT> <EOL> reader_progress = apiclient . cloud_progress_to_reader_progress ( <EOL> cloud_progress ) <EOL> self . assertIsNotNone ( reader_progress . percent_complete ) <EOL> self . assertEqual ( <NUM_LIT> , reader_progress . percent_complete ) <EOL> def test_cloud_position_to_reader_position_byte_offset ( self ) : <EOL> cloud_position = dataflow . Position ( ) <EOL> cloud_position . byteOffset = <NUM_LIT> <EOL> reader_position = apiclient . cloud_position_to_reader_position ( <EOL> cloud_position ) <EOL> self . assertIsNotNone ( reader_position ) <EOL> self . assertIsInstance ( reader_position , iobase . ReaderPosition ) <EOL> self . assertEqual ( <NUM_LIT> , reader_position . byte_offset ) <EOL> def test_approximate_progress_to_dynamic_split_request ( self ) : <EOL> approximate_progress = dataflow . ApproximateProgress ( ) <EOL> approximate_progress . percentComplete = <NUM_LIT> <EOL> dynamic_split_request = ( <EOL> apiclient . approximate_progress_to_dynamic_split_request ( <EOL> approximate_progress ) ) <EOL> self . assertIsNotNone ( dynamic_split_request ) <EOL> self . assertIsInstance ( dynamic_split_request . progress , iobase . ReaderProgress ) <EOL> self . assertIsNotNone ( dynamic_split_request . progress . percent_complete ) <EOL> self . assertEqual ( dynamic_split_request . progress . percent_complete , <NUM_LIT> ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
