Module Expr Str ImportFrom alias Import alias Import alias Import alias TryExcept body ImportFrom alias identifier handlers ExceptHandler type NameLoad body ImportFrom alias identifier ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias If CompareIn AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad keyword Str keyword AttributeLoad NameLoad attr FunctionDef arguments args defaults vararg kwarg body Assign NameStore Call NameLoad With Call NameLoad Str Lambda arguments args defaults NameLoad body Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assert CompareEq AttributeLoad NameLoad attr Num Assert CompareEq Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body FunctionDef arguments args defaults body Raise NameLoad decorator_list TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad Assert NameLoad Str handlers ExceptHandler type NameLoad name NameStore body Assert CompareEq Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr Str Expr Yield Assign AttributeStore NameLoad attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Assert CompareIs NameLoad Call AttributeLoad NameLoad attr NameLoad Assert CompareEq Str Call AttributeLoad NameLoad attr Str Assert CompareEq TupleLoad Num Call AttributeLoad NameLoad attr TupleLoad Num Assert CompareIs NameLoad Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Assert CompareEq ListLoad Str Call AttributeLoad NameLoad attr Str keyword NameLoad Assert CompareEq TupleLoad Num Call AttributeLoad NameLoad attr TupleLoad Num keyword NameLoad With Call NameLoad Str body Assert CompareEq Str Call AttributeLoad NameLoad attr Str With Call NameLoad Str body Assert CompareEq Str Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Assert CompareEq Str Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Assert CompareEq Str Call AttributeLoad NameLoad attr BinOpMod Str NameLoad TryExcept body Assign NameStore Str Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Assert NameLoad handlers ExceptHandler type NameLoad name NameStore body Assert CompareEq Call NameLoad NameLoad BinOpMod Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str keyword NameLoad Assert CompareEq BinOpMult ListLoad Str Num NameLoad decorator_list FunctionDef arguments args defaults body Expr Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Expr Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Str decorator_list FunctionDef arguments args defaults body Assign NameStore Call NameLoad ListLoad Str Assert CompareEq AttributeLoad NameLoad attr BinOpMod Str AttributeLoad NameLoad attr decorator_list FunctionDef arguments args defaults body Assert CompareNotIn Str AttributeLoad NameLoad attr Expr Call NameLoad ListLoad Str Str Str Assert CompareIn Str AttributeLoad NameLoad attr Assert CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Str Num decorator_list FunctionDef arguments args defaults body Expr Call NameLoad ListLoad Str Str Str Assert CompareIn Str AttributeLoad NameLoad attr Assert CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Str Str decorator_list FunctionDef arguments args defaults body Assign NameStore Call NameLoad FunctionDef arguments args defaults vararg body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assert CompareNotEq AttributeLoad NameLoad attr Num Assert CompareEq Str AttributeLoad NameLoad attr Return NameLoad decorator_list Assert Call NameLoad Call NameLoad NameLoad ListLoad TupleLoad Str TupleLoad Str Str TupleLoad Str Str TupleLoad Str Str TupleLoad Str Str TupleLoad Str decorator_list FunctionDef arguments args defaults body Assign NameStore Call NameLoad Str Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call NameLoad ListLoad Str Expr Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Expr Call NameLoad ListLoad Str Str Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword Num keyword NameLoad keyword Str decorator_list FunctionDef arguments args defaults body Assign NameStore Call NameLoad Str Assign NameStore Call NameLoad Str Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call NameLoad ListLoad Str keyword NameLoad Expr Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Assign NameStore Call NameLoad Str Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call NameLoad ListLoad Str Str Expr Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad FunctionDef arguments args NameParam NameParam defaults NameLoad body Assign TupleStore NameStore NameStore TupleLoad ListLoad Str NameLoad If NameLoad body Assign NameStore Call AttributeLoad Str attr NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad Call NameLoad NameLoad keyword NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assert CompareEq AttributeLoad NameLoad attr Num Assign NameStore SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num Assert CompareEq Call NameLoad NameLoad Call NameLoad SubscriptLoad NameLoad Index Num Assert CompareEq Str SubscriptLoad NameLoad Index Num Assert CompareEq Str SubscriptLoad NameLoad Index Num decorator_list Expr Call NameLoad ListLoad Str Expr Call NameLoad ListLoad Str Str Expr Call NameLoad ListLoad Str keyword NameLoad Expr Call NameLoad ListLoad Str Str keyword NameLoad decorator_list FunctionDef arguments args defaults body Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad FunctionDef arguments args NameParam NameParam defaults NameLoad body Assign TupleStore NameStore NameStore TupleLoad ListLoad Str NameLoad If NameLoad body Assign NameStore Call AttributeLoad Str attr NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad Call NameLoad NameLoad keyword NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assert CompareEq AttributeLoad NameLoad attr Num Assign NameStore SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num Assert CompareEq Call NameLoad NameLoad Call NameLoad SubscriptLoad NameLoad Index Num Assert CompareEq Str SubscriptLoad NameLoad Index Num Assert CompareEq Str SubscriptLoad NameLoad Index Num decorator_list Expr Call NameLoad ListLoad Str Expr Call NameLoad ListLoad Str Str Expr Call NameLoad ListLoad Str keyword NameLoad Expr Call NameLoad ListLoad Str Str keyword NameLoad decorator_list FunctionDef arguments args defaults body Assign NameStore Str Assign AttributeStore AttributeLoad NameLoad attr attr Lambda arguments args defaults NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr Dict Str Str TryFinally body Assign NameStore Call NameLoad ListLoad Str Str Str Str Str Assert CompareEq AttributeLoad NameLoad attr Num Assert Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad With Call NameLoad NameLoad NameStore body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Assert CompareEq SubscriptLoad NameLoad Index Str Str finalbody If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args defaults body Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr Assign AttributeStore AttributeLoad NameLoad attr attr Str Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call NameLoad ListLoad Str Str Assert CompareEq AttributeLoad NameLoad attr Num Assert CompareEq AttributeLoad NameLoad attr Str Assign NameStore SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num Assert CompareEq SubscriptLoad NameLoad Index Num Str decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr Assign AttributeStore AttributeLoad NameLoad attr attr Str Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore BinOpAdd ListLoad Str Call NameLoad NameLoad If CompareIsNot NameLoad NameLoad body AugAssignAdd NameStore ListLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad keyword Call AttributeLoad NameLoad attr Str NameLoad Assert CompareEq AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num decorator_list FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad Str Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad NameLoad Expr Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad Str Assign NameStore Call NameLoad NameLoad Expr Call NameLoad NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad Str Assign NameStore Call NameLoad NameLoad Expr Call NameLoad NameLoad Str Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str decorator_list FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad Str Assign NameStore Call NameLoad NameLoad Expr Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad SubscriptLoad NameLoad Index Str decorator_list FunctionDef arguments args defaults body Assign NameStore Dict Str Str Assign NameStore Dict Str Str Str Dict Str Dict Str NameLoad Expr Call NameLoad Dict Str Str Str Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call NameLoad Dict Str Str Str Str keyword Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Expr Call NameLoad Dict Str Str Str Str Assign NameStore Dict Str Dict Str Dict Str Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list
N/A N/A 
Command line specific tests - the client should be completely mocked and the
focus should be on asserting any CLI logic prior to client method invocation

lower level lib/client tests go in the test_mod suite
 contextlib contextmanager N/A json N/A os N/A sys N/A N/A StringIO StringIO Buffy N/A N/A N/A ImportError N/A io BytesIO Buffy click ClickException click.testing CliRunner mock MagicMock mock patch N/A planet planet api planet.api models planet scripts _common read_fixture _common clone N/A N/A N/A N/A api auth ENV_KEY N/A os environ N/A N/A N/A N/A N/A os environ pop N/A N/A api auth ENV_KEY N/A client N/A MagicMock name client spec N/A api Client run_cli N/A N/A N/A args kw N/A N/A runner N/A CliRunner N/A N/A patch planet.scripts.client N/A N/A N/A N/A client N/A N/A N/A N/A runner invoke N/A scripts cli args kw N/A assert_success N/A N/A result expected N/A N/A N/A N/A N/A result exit_code 0 N/A N/A N/A N/A json loads N/A result output N/A N/A json loads expected N/A assert_cli_exception N/A N/A cause expected N/A N/A thrower N/A N/A N/A N/A N/A cause N/A N/A N/A N/A N/A N/A scripts call_and_wrap thrower N/A False did not throw N/A N/A N/A ClickException N/A ex N/A N/A N/A N/A str ex expected N/A stdin N/A N/A content N/A N/A N/A saved N/A sys stdin N/A N/A sys stdin N/A Buffy N/A N/A content encode utf-8 N/A N/A N/A N/A sys stdin saved N/A contextmanager test_read N/A N/A tmpdir N/A N/A N/A N/A None N/A N/A scripts read None N/A N/A foo N/A N/A scripts read foo N/A N/A N/A 1 N/A N/A scripts read N/A 1 N/A N/A None N/A N/A scripts read None split True N/A N/A N/A foo N/A N/A scripts read foo split True N/A N/A N/A 1 N/A N/A scripts read N/A 1 split True N/A N/A stdin text N/A N/A N/A text N/A N/A scripts read - N/A N/A stdin text N/A N/A N/A text N/A N/A scripts read @- N/A infile N/A N/A tmpdir join infile N/A N/A N/A infile write farb N/A N/A farb N/A N/A scripts read N/A @%s infile N/A N/A farb N/A N/A scripts read N/A %s infile N/A N/A N/A noexist not-here-hopefully N/A N/A N/A scripts read N/A @%s noexist N/A False N/A N/A N/A ClickException N/A ex N/A N/A N/A N/A str ex N/A [Errno 2] No such file or directory: '%s' noexist N/A xs N/A N/A scripts read  x
x
x		x	
 x  split True N/A N/A N/A N/A x 5 xs N/A test_exception_translation N/A N/A N/A N/A N/A N/A assert_cli_exception N/A N/A N/A api exceptions BadQuery bogus BadQuery: bogus N/A N/A assert_cli_exception N/A N/A N/A api exceptions APIException 911: alert Unexpected response: 911: alert N/A test_version_flag N/A N/A N/A N/A N/A results N/A run_cli N/A --version N/A N/A N/A results output N/A %s
 N/A planet __version__ N/A test_workers_flag N/A N/A N/A N/A N/A N/A workers N/A scripts client_params N/A N/A run_cli N/A --workers 19 search N/A N/A workers N/A scripts client_params N/A N/A N/A N/A scripts client_params N/A workers 19 N/A test_api_key_flag N/A N/A N/A N/A N/A N/A run_cli N/A -k shazbot search N/A N/A api_key N/A scripts client_params N/A N/A N/A N/A scripts client_params N/A api_key shazbot N/A test_no_api_key N/A N/A N/A N/A N/A runner N/A CliRunner assert_no_api_key N/A N/A N/A args N/A N/A result N/A N/A runner invoke N/A scripts cli args N/A N/A N/A result exit_code 0 N/A N/A Error: InvalidAPIKey: No API key provided
 N/A result output N/A True N/A N/A N/A all N/A map assert_no_api_key N/A N/A search N/A metadata whatever N/A download whatever N/A thumbnails whatever N/A mosaic-quads whatever N/A list-workspaces N/A test_search N/A N/A N/A N/A N/A expected N/A read_fixture search.geojson N/A response N/A MagicMock spec N/A models JSON N/A N/A N/A response get_raw return_value expected N/A N/A N/A client get_scenes_list return_value response N/A result N/A run_cli N/A search N/A N/A assert_success result expected N/A test_aoi_id_flag N/A N/A N/A N/A N/A N/A run_cli N/A search --aoi_id dangbat N/A N/A N/A N/A client get_scenes_list assert_called_with aoi_id dangbat count 1000 intersects None scene_type ortho N/A test_search_by_aoi N/A N/A N/A N/A N/A aoi N/A read_fixture search-by-aoi.geojson N/A expected N/A read_fixture search-by-aoi.geojson N/A response N/A MagicMock spec N/A models JSON N/A N/A N/A response get_raw return_value expected N/A N/A N/A client get_scenes_list return_value response N/A result N/A run_cli N/A search input aoi N/A N/A assert_success result expected N/A test_metadata N/A N/A N/A N/A N/A expected N/A read_fixture 20150615_190229_0905.geojson N/A response N/A MagicMock spec N/A models JSON N/A N/A N/A response get_raw return_value expected N/A N/A N/A client get_scene_metadata return_value response N/A result N/A run_cli N/A metadata 20150615_190229_0905 N/A N/A assert_success result expected N/A test_download N/A N/A N/A N/A N/A response N/A MagicMock spec N/A models Image N/A N/A N/A client fetch_scene_geotiffs return_value response test N/A N/A ids as_std_in N/A False N/A N/A N/A args input N/A N/A download None N/A as_std_in N/A N/A input N/A N/A join ids N/A N/A N/A N/A args extend ids N/A N/A assert_correct N/A run_cli args input input ids N/A assert_correct N/A N/A result expected_ids N/A N/A N/A N/A N/A result exit_code 0 N/A called_with N/A N/A N/A client fetch_scene_geotiffs call_args N/A 0 N/A N/A N/A list expected_ids N/A list N/A called_with N/A 0 N/A N/A ortho N/A called_with N/A 1 N/A N/A visual N/A called_with N/A 2 N/A N/A N/A test N/A 20150615_190229_0905 N/A N/A test N/A 20150615_190229_0905 20150615_190229_0906 N/A N/A test N/A 20150615_190229_0905 as_std_in True N/A N/A test N/A 20150615_190229_0905 20150615_190229_0906 as_std_in True N/A test_thumbs N/A N/A N/A N/A N/A response N/A MagicMock spec N/A models Image N/A N/A N/A client fetch_scene_thumbnails return_value response test N/A N/A ids as_std_in N/A False N/A N/A N/A args input N/A N/A thumbnails None N/A as_std_in N/A N/A input N/A N/A join ids N/A N/A N/A N/A args extend ids N/A N/A assert_correct N/A run_cli args input input ids N/A assert_correct N/A N/A result expected_ids N/A N/A N/A N/A N/A result exit_code 0 N/A called_with N/A N/A N/A client fetch_scene_thumbnails call_args N/A 0 N/A N/A N/A list expected_ids N/A list N/A called_with N/A 0 N/A N/A ortho N/A called_with N/A 1 N/A N/A md N/A called_with N/A 2 N/A N/A N/A test N/A 20150615_190229_0905 N/A N/A test N/A 20150615_190229_0905 20150615_190229_0906 N/A N/A test N/A 20150615_190229_0905 as_std_in True N/A N/A test N/A 20150615_190229_0905 20150615_190229_0906 as_std_in True N/A test_init N/A N/A N/A N/A N/A test_file .test_planet_json N/A N/A N/A api utils _planet_json_file N/A N/A N/A N/A test_file N/A N/A N/A client login return_value N/A api_key SECRIT N/A N/A N/A result N/A run_cli N/A init --email bil@ly --password secret N/A N/A N/A result exit_code 0 N/A N/A N/A N/A os path exists test_file N/A N/A open test_file fp N/A N/A data N/A N/A json loads N/A N/A fp read N/A N/A N/A data N/A key SECRIT N/A N/A N/A N/A N/A os path exists test_file N/A N/A N/A N/A os unlink test_file N/A test_mosaic_quads N/A N/A N/A N/A N/A response N/A MagicMock spec N/A models JSON N/A N/A N/A response get_raw return_value {"quads": []} N/A N/A N/A client get_mosaic_quads return_value response N/A result N/A run_cli N/A mosaic-quads some_mosaic_name N/A N/A N/A result exit_code 0 N/A N/A N/A result output {
  "quads": []
}
 N/A called_with N/A N/A N/A client get_mosaic_quads call_args N/A 0 N/A N/A N/A called_with N/A 0 some_mosaic_name N/A _set_workspace N/A N/A workspace N/A args kw N/A N/A response N/A MagicMock spec N/A models JSON N/A N/A N/A response get_raw return_value {"status": "OK"} N/A N/A N/A client set_workspace return_value response N/A N/A N/A N/A client set_workspace reset_mock N/A args N/A N/A set-workspace N/A list args N/A N/A workspace None N/A N/A args N/A N/A N/A json dumps workspace N/A result N/A run_cli args input N/A N/A kw get input None N/A N/A N/A result exit_code N/A N/A kw get expected_status 0 N/A test_workspace_create_no_id N/A N/A N/A N/A N/A workspace N/A N/A json loads N/A read_fixture workspace.json N/A N/A N/A workspace pop id N/A expected N/A clone workspace N/A N/A _set_workspace workspace N/A N/A N/A N/A client set_workspace assert_called_once_with expected None N/A test_workspace_create_from_existing N/A N/A N/A N/A N/A workspace N/A N/A json loads N/A read_fixture workspace.json N/A expected N/A clone workspace N/A N/A _set_workspace workspace --create N/A N/A N/A N/A client set_workspace assert_called_once_with expected None N/A test_workspace_update_from_existing_with_id N/A N/A N/A N/A N/A workspace N/A N/A json loads N/A read_fixture workspace.json N/A expected N/A clone workspace N/A N/A _set_workspace workspace --id 12345 N/A N/A N/A N/A client set_workspace assert_called_once_with expected 12345 N/A test_workspace_update_stdin N/A N/A N/A N/A N/A workspace N/A N/A json loads N/A read_fixture workspace.json N/A expected N/A clone workspace N/A N/A _set_workspace workspace N/A N/A N/A N/A client set_workspace assert_called_once_with expected N/A workspace N/A id N/A test_workspace_create_aoi_stdin N/A N/A N/A N/A N/A geometry N/A type Point N/A expected N/A name filters foobar N/A geometry N/A intersects geometry N/A N/A _set_workspace N/A --name foobar --aoi N/A N/A json dumps geometry N/A N/A N/A N/A client set_workspace assert_called_once_with expected None N/A N/A _set_workspace N/A --name foobar --aoi @- input N/A N/A json dumps geometry N/A N/A N/A N/A client set_workspace assert_called_once_with expected None N/A test_set_workspace_filters N/A N/A N/A N/A N/A N/A _set_workspace N/A --where sat.id eq 0 N/A expected N/A filters N/A sat.id N/A eq 0 N/A N/A N/A N/A client set_workspace assert_called_once_with expected None N/A