def test_bad_resolution_spec_too_many_items(self): responses_add_dem_mocks() ws_dir, tgt_path = self.prepare_single_file_download() new_argv = ['ruaumoko-download', '--expect-resolution', '20x10x1', tgt_path] with patch('sys.argv', new_argv): status = rd.main() self.assertEqual(status, 1)
def test_bad_resolution_spec_non_numeric(self): self.responses_add_mocks() ws_dir, tgt_path = self.prepare_single_file_download() new_argv = ['ruaumoko-download', '--expect-resolution', 'WxZ', tgt_path] with patch('sys.argv', new_argv): status = rd.main() self.assertEqual(status, 1)
def test_download_all_chunks_via_main(self): responses_add_dem_mocks() ws_dir, tgt_path = self.prepare_single_file_download() new_argv = ['ruaumoko-download', '--expect-resolution', '20x10', tgt_path] with patch('sys.argv', new_argv): status = rd.main() self.assertEqual(status, 0) self.check_single_file_download(24, tgt_path, ws_dir)
def test_download_split_chunks_via_main(self): responses_add_dem_mocks() ws_dir, chunk_dir = self.prepare_multiple_chunk_download() new_argv = ['ruaumoko-download', '--expect-resolution', '20x10', '--split-chunks', chunk_dir] with patch('sys.argv', new_argv): status = rd.main() self.assertEqual(status, 0) self.check_multiple_chunk_download(24, ws_dir, chunk_dir, '15-', '.tif')