#NEWLINE# def test_sync_tool_init( tmpdir ) : #NEWLINE# #INDENT# td = tmpdir . mkdir ( 'sync-dest' ) #NEWLINE# aoi = read_fixture ( 'aoi.geojson' ) #NEWLINE# st = _SyncTool ( client , search_json . strpath , aoi , 'ortho' , ( 'visual' , 'analytic' ) ) #NEWLINE# search_json = json . loads ( read_fixture ( 'search.geojson' ) ) #NEWLINE# response = MagicMock ( spec = Scenes ) #NEWLINE# response . get . return_value = search_json #NEWLINE# client . get_scenes_list . return_value = response #NEWLINE# count = st . init ( ) #NEWLINE# assert ( ( search_json [ 'count' ] * 2 ) == count ) #NEWLINE# count = st . init ( limit = 10 ) #NEWLINE# assert ( ( search_json [ 'count' ] * 2 ) == count ) #NEWLINE# assert ( 10 == st . _scene_count ) #NEWLINE# latest = '2015-01-25T18:29:09.155671+00:00' #NEWLINE# td . join ( 'sync.json' ) . write ( json . dumps ( { #NEWLINE# #INDENT# 'latest' : latest , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# st . init ( ) #NEWLINE# args = client . get_scenes_list . call_args #NEWLINE# assert ( args [ 1 ] [ 'published.gt' ] == latest ) #NEWLINE# td . remove ( True )