7
7
8
8
from ..core import HSAClass
9
9
10
- spire_chksum = [10233 , 10762 , 9019 , 10869 , 3944 , 11328 , 3921 , 10999 , 10959 ,
11
- 11342 , 10974 , 3944 , 11335 , 11323 , 11078 , 11321 , 11089 , 11314 , 11108 , 6281 ]
12
10
13
- pacs_chksum = [10208 , 10755 , 8917 , 10028 , 3924 , 3935 , 6291 ]
11
+
12
+ PACS_ENDINGS = ["571.xml" , "571.jpg" , "214.fits.gz" , "008.fits.gz" ,
13
+ "674.fits.gz" , "350.fits.gz" , "README.pdf" ]
14
+ SPIRE_ENDINGS = ["898.xml" , "898.jpg" , "141.fits.gz" , "045.fits.gz" , "952.fits.gz" ,
15
+ "974.fits.gz" , "715.fits.gz" , "547.fits.gz" , "770.fits.gz" ,
16
+ "856.fits.gz" , "148.fits.gz" , "025.fits.gz" , "538.fits.gz" ,
17
+ "070.fits.gz" , "434.fits.gz" , "637.fits.gz" , "835.fits.gz" ,
18
+ "372.fits.gz" ,"248.fits.gz" , "README.pdf" ]
14
19
15
20
16
21
@pytest .mark .remote_data
@@ -42,8 +47,10 @@ def test_download_data_observation_pacs(self, tmp_path):
42
47
assert Path (res ) == expected_res
43
48
assert Path (res ).is_file ()
44
49
with tarfile .open (res ) as tar :
45
- chksum = [m .chksum for m in tar .getmembers ()]
46
- assert chksum .sort () == pacs_chksum .sort ()
50
+ names = tar .getnames ()
51
+ assert len (names ) == len (PACS_ENDINGS )
52
+ for name , ending in zip (names , PACS_ENDINGS ):
53
+ assert name .endswith (ending )
47
54
48
55
def test_download_data_observation_pacs_filename (self , tmp_path ):
49
56
obs_id = "1342191813"
@@ -63,8 +70,10 @@ def test_download_data_observation_pacs_filename(self, tmp_path):
63
70
assert Path (res ) == expected_res
64
71
assert Path (res ).is_file ()
65
72
with tarfile .open (res ) as tar :
66
- chksum = [m .chksum for m in tar .getmembers ()]
67
- assert chksum .sort () == pacs_chksum .sort ()
73
+ names = tar .getnames ()
74
+ assert len (names ) == len (PACS_ENDINGS )
75
+ for name , ending in zip (names , PACS_ENDINGS ):
76
+ assert name .endswith (ending )
68
77
69
78
def test_download_data_observation_pacs_compressed (self , tmp_path ):
70
79
obs_id = "1342191813"
@@ -83,8 +92,10 @@ def test_download_data_observation_pacs_compressed(self, tmp_path):
83
92
assert Path (res ) == expected_res
84
93
assert Path (res ).is_file ()
85
94
with tarfile .open (res ) as tar :
86
- chksum = [m .chksum for m in tar .getmembers ()]
87
- assert chksum .sort () == pacs_chksum .sort ()
95
+ names = tar .getnames ()
96
+ assert len (names ) == len (PACS_ENDINGS )
97
+ for name , ending in zip (names , PACS_ENDINGS ):
98
+ assert name .endswith (ending )
88
99
89
100
def test_download_data_observation_spire (self , tmp_path ):
90
101
obs_id = "1342191188"
@@ -102,8 +113,10 @@ def test_download_data_observation_spire(self, tmp_path):
102
113
assert Path (res ) == expected_res
103
114
assert Path (res ).is_file ()
104
115
with tarfile .open (res ) as tar :
105
- chksum = [m .chksum for m in tar .getmembers ()]
106
- assert chksum .sort () == spire_chksum .sort ()
116
+ names = tar .getnames ()
117
+ assert len (names ) == len (SPIRE_ENDINGS )
118
+ for name , ending in zip (names , SPIRE_ENDINGS ):
119
+ assert name .endswith (ending )
107
120
108
121
def test_download_data_postcard_pacs (self , tmp_path ):
109
122
obs_id = "1342191813"
@@ -152,8 +165,10 @@ def test_get_observation(self, tmp_path):
152
165
assert Path (res ) == expected_res
153
166
assert Path (res ).is_file ()
154
167
with tarfile .open (res ) as tar :
155
- chksum = [m .chksum for m in tar .getmembers ()]
156
- assert chksum .sort () == pacs_chksum .sort ()
168
+ names = tar .getnames ()
169
+ assert len (names ) == len (PACS_ENDINGS )
170
+ for name , ending in zip (names , PACS_ENDINGS ):
171
+ assert name .endswith (ending )
157
172
158
173
def test_get_postcard (self , tmp_path ):
159
174
obs_id = "1342191813"
0 commit comments