File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed
Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change 11"""Defines the BrainGlobeAtlas class for accessing brain atlas data."""
22
3+ import shutil
34import tarfile
5+ import warnings
46from collections .abc import Callable
57from io import StringIO
68from pathlib import Path
79from typing import Optional , Tuple , Union
8- import shutil
9- import warnings
10+
1011import requests
1112from rich import print as rprint
1213from rich .console import Console
@@ -118,7 +119,7 @@ def __init__(
118119
119120 if check_latest :
120121 self .check_latest_version ()
121-
122+
122123 @property
123124 def local_version (self ) -> Optional [Tuple [int , ...]]:
124125 """If atlas is local, return actual version of the downloaded files;
Original file line number Diff line number Diff line change 11from brainglobe_atlasapi .bg_atlas import BrainGlobeAtlas
22
3+
34def test_recovers_missing_metadata (mocker ):
45 """
56 Test that BrainGlobeAtlas recovers from missing metadata by re-downloading.
67 """
7-
88 # Mock Atlas.__init__: fail once, succeed second time
99 mock_atlas_init = mocker .patch (
1010 "brainglobe_atlasapi.core.Atlas.__init__" ,
@@ -27,15 +27,11 @@ def test_recovers_missing_metadata(mocker):
2727 "brainglobe_atlasapi.bg_atlas.BrainGlobeAtlas.check_latest_version"
2828 )
2929
30- mock_rmtree = mocker .patch (
31- "brainglobe_atlasapi.bg_atlas.shutil.rmtree"
32- )
30+ mock_rmtree = mocker .patch ("brainglobe_atlasapi.bg_atlas.shutil.rmtree" )
3331
3432 # Act
3533 BrainGlobeAtlas ("example_mouse_100um" , check_latest = False )
3634
3735 # Assert
3836 assert mock_atlas_init .call_count == 2
3937 mock_download .assert_called_once ()
40-
41-
You can’t perform that action at this time.
0 commit comments