#NEWLINE# def test_encode_coordinate( config ) : #NEWLINE# #INDENT# 'Test encoding of a coordinate string.' #NEWLINE# O . init_osm_factory ( config ) #NEWLINE# _sf = config . getint ( C . DATASTORE , C . SCALE_FACTOR ) #NEWLINE# assert ( _sf == 10000000 ) #NEWLINE# inputlist = [ ( '0' , 0 ) , ( '0.00123456' , 12345 ) , ( '0.12345678' , 1234567 ) , ( '1.23456789' , 12345678 ) , ( '12.3456789' , 123456789 ) , ( '123.456789' , 1234567890 ) , ( '1' , 10000000 ) , ( '12' , 120000000 ) , ( '123' , 1230000000 ) ] #NEWLINE# for ( strval , refval ) in inputlist : #NEWLINE# #INDENT# v = O . encode_coordinate ( strval ) #NEWLINE# assert ( refval == v ) #NEWLINE# #UNINDENT# inputlist = [ ( 0.0 , 0 ) , ( 0.123456 , 1234560 ) , ( 0.1234567 , 1234567 ) , ( 1.0 , 10000000 ) , ( 1.23456 , 12345600 ) , ( 12.3455899 , 123455899 ) ] #NEWLINE# for ( flval , refval ) in inputlist : #NEWLINE# #INDENT# v = O . encode_coordinate ( flval ) #NEWLINE# assert ( v == refval )