44import numpy as np
55import pytest
66
7- from sbpy .utils import dastcom5
7+ from sbpy .data . utils import dastcom5
88
99
10- @mock .patch ("sbpy.utils.dastcom5.np.fromfile" )
11- @mock .patch ("sbpy.utils.dastcom5.open" )
10+ @mock .patch ("sbpy.data. utils.dastcom5.np.fromfile" )
11+ @mock .patch ("sbpy.data. utils.dastcom5.open" )
1212def test_asteroid_db_is_called_with_right_path (mock_open , mock_np_fromfile ):
1313 dastcom5 .asteroid_db ()
1414 mock_open .assert_called_with (dastcom5 .AST_DB_PATH , "rb" )
1515
1616
17- @mock .patch ("sbpy.utils.dastcom5.np.fromfile" )
18- @mock .patch ("sbpy.utils.dastcom5.open" )
17+ @mock .patch ("sbpy.data. utils.dastcom5.np.fromfile" )
18+ @mock .patch ("sbpy.data. utils.dastcom5.open" )
1919def test_comet_db_is_called_with_right_path (mock_open , mock_np_fromfile ):
2020 dastcom5 .comet_db ()
2121 mock_open .assert_called_with (dastcom5 .COM_DB_PATH , "rb" )
2222
2323
24- @mock .patch ("sbpy.utils.dastcom5.np.fromfile" )
25- @mock .patch ("sbpy.utils.dastcom5.open" )
24+ @mock .patch ("sbpy.data. utils.dastcom5.np.fromfile" )
25+ @mock .patch ("sbpy.data. utils.dastcom5.open" )
2626def test_read_headers (mock_open , mock_np_fromfile ):
2727 dastcom5 .read_headers ()
2828 mock_open .assert_any_call (
@@ -33,9 +33,9 @@ def test_read_headers(mock_open, mock_np_fromfile):
3333 )
3434
3535
36- @mock .patch ("sbpy.utils.dastcom5.read_headers" )
37- @mock .patch ("sbpy.utils.dastcom5.np.fromfile" )
38- @mock .patch ("sbpy.utils.dastcom5.open" )
36+ @mock .patch ("sbpy.data. utils.dastcom5.read_headers" )
37+ @mock .patch ("sbpy.data. utils.dastcom5.np.fromfile" )
38+ @mock .patch ("sbpy.data. utils.dastcom5.open" )
3939def test_read_record (mock_open , mock_np_fromfile , mock_read_headers ):
4040 mocked_ast_headers = np .array (
4141 [(3184 , - 1 , b"00740473" , b"00496815" )],
@@ -59,10 +59,10 @@ def test_read_record(mock_open, mock_np_fromfile, mock_read_headers):
5959 )
6060
6161
62- @mock .patch ("sbpy.utils.dastcom5.os.makedirs" )
63- @mock .patch ("sbpy.utils.dastcom5.zipfile" )
64- @mock .patch ("sbpy.utils.dastcom5.os.path.isdir" )
65- @mock .patch ("sbpy.utils.dastcom5.urllib.request" )
62+ @mock .patch ("sbpy.data. utils.dastcom5.os.makedirs" )
63+ @mock .patch ("sbpy.data. utils.dastcom5.zipfile" )
64+ @mock .patch ("sbpy.data. utils.dastcom5.os.path.isdir" )
65+ @mock .patch ("sbpy.data. utils.dastcom5.urllib.request" )
6666def test_download_dastcom5_raises_error_when_folder_exists (
6767 mock_request , mock_isdir , mock_zipfile , mock_makedirs
6868):
@@ -76,10 +76,10 @@ def test_download_dastcom5_raises_error_when_folder_exists(
7676 )
7777
7878
79- @mock .patch ("sbpy.utils.dastcom5.urllib.request" )
80- @mock .patch ("sbpy.utils.dastcom5.os.makedirs" )
81- @mock .patch ("sbpy.utils.dastcom5.zipfile" )
82- @mock .patch ("sbpy.utils.dastcom5.os.path.isdir" )
79+ @mock .patch ("sbpy.data. utils.dastcom5.urllib.request" )
80+ @mock .patch ("sbpy.data. utils.dastcom5.os.makedirs" )
81+ @mock .patch ("sbpy.data. utils.dastcom5.zipfile" )
82+ @mock .patch ("sbpy.data. utils.dastcom5.os.path.isdir" )
8383def test_download_dastcom5_creates_folder (
8484 mock_isdir , mock_zipfile , mock_makedirs , mock_request
8585):
@@ -89,9 +89,9 @@ def test_download_dastcom5_creates_folder(
8989 mock_makedirs .assert_called_once_with (dastcom5 .SBPY_LOCAL_PATH )
9090
9191
92- @mock .patch ("sbpy.utils.dastcom5.zipfile" )
93- @mock .patch ("sbpy.utils.dastcom5.os.path.isdir" )
94- @mock .patch ("sbpy.utils.dastcom5.urllib.request.urlretrieve" )
92+ @mock .patch ("sbpy.data. utils.dastcom5.zipfile" )
93+ @mock .patch ("sbpy.data. utils.dastcom5.os.path.isdir" )
94+ @mock .patch ("sbpy.data. utils.dastcom5.urllib.request.urlretrieve" )
9595def test_download_dastcom5_downloads_file (
9696 mock_request , mock_isdir , mock_zipfile
9797):
0 commit comments