Skip to content

Commit 93858cc

Browse files
authored
Merge pull request #170 from NASA-PDS/i169
Adds a new set of test data `naif3` in order to avoid dependency on a remote web server that may be down for an extended period of time
2 parents c085ac1 + 05ababf commit 93858cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+6291
-41
lines changed

.secrets.baseline

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,71 @@
223223
"is_verified": false,
224224
"line_number": 32
225225
}
226+
],
227+
"test/data/naif3/spice_kernels/m2020_168_sclkscet_00007.tsc": [
228+
{
229+
"type": "Email Address",
230+
"filename": "test/data/naif3/spice_kernels/m2020_168_sclkscet_00007.tsc",
231+
"hashed_secret": "34af3d6f31b0b9c0d5bbbeb8d2e27a7623f8f481",
232+
"is_verified": false,
233+
"line_number": 67
234+
},
235+
{
236+
"type": "Email Address",
237+
"filename": "test/data/naif3/spice_kernels/m2020_168_sclkscet_00007.tsc",
238+
"hashed_secret": "dbfbf317dd33075578e4165b8741dc04cb833d78",
239+
"is_verified": false,
240+
"line_number": 71
241+
}
242+
],
243+
"test/data/naif3/spice_kernels/m2020_168_sclkscet_refit_v01.tsc": [
244+
{
245+
"type": "Email Address",
246+
"filename": "test/data/naif3/spice_kernels/m2020_168_sclkscet_refit_v01.tsc",
247+
"hashed_secret": "34af3d6f31b0b9c0d5bbbeb8d2e27a7623f8f481",
248+
"is_verified": false,
249+
"line_number": 72
250+
},
251+
{
252+
"type": "Email Address",
253+
"filename": "test/data/naif3/spice_kernels/m2020_168_sclkscet_refit_v01.tsc",
254+
"hashed_secret": "dbfbf317dd33075578e4165b8741dc04cb833d78",
255+
"is_verified": false,
256+
"line_number": 76
257+
}
258+
],
259+
"test/data/naif3/spice_kernels/m2020_168_sclkscet_refit_v02.tsc": [
260+
{
261+
"type": "Email Address",
262+
"filename": "test/data/naif3/spice_kernels/m2020_168_sclkscet_refit_v02.tsc",
263+
"hashed_secret": "34af3d6f31b0b9c0d5bbbeb8d2e27a7623f8f481",
264+
"is_verified": false,
265+
"line_number": 72
266+
},
267+
{
268+
"type": "Email Address",
269+
"filename": "test/data/naif3/spice_kernels/m2020_168_sclkscet_refit_v02.tsc",
270+
"hashed_secret": "dbfbf317dd33075578e4165b8741dc04cb833d78",
271+
"is_verified": false,
272+
"line_number": 76
273+
}
274+
],
275+
"test/data/naif3/spice_kernels/m2020_168_sclkscet_refit_v03.tsc": [
276+
{
277+
"type": "Email Address",
278+
"filename": "test/data/naif3/spice_kernels/m2020_168_sclkscet_refit_v03.tsc",
279+
"hashed_secret": "34af3d6f31b0b9c0d5bbbeb8d2e27a7623f8f481",
280+
"is_verified": false,
281+
"line_number": 72
282+
},
283+
{
284+
"type": "Email Address",
285+
"filename": "test/data/naif3/spice_kernels/m2020_168_sclkscet_refit_v03.tsc",
286+
"hashed_secret": "dbfbf317dd33075578e4165b8741dc04cb833d78",
287+
"is_verified": false,
288+
"line_number": 76
289+
}
226290
]
227291
},
228-
"generated_at": "2024-04-19T15:04:19Z"
292+
"generated_at": "2024-06-06T14:31:55Z"
229293
}

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,29 @@ All users and developers of the NASA-PDS software are expected to abide by our [
6565
- Wiki: https://github.com/NASA-PDS/deep-archive/wiki
6666

6767

68+
### 💽 Getting Test Data
69+
70+
If you need to mirror a part of a website to add to the test data, try this handy invocation of `wget`:
71+
```console
72+
$ wget \
73+
--quiet \
74+
--execute robots=off \
75+
--cut-dirs=2 \
76+
--reject='index.html*' \
77+
--no-host-directories \
78+
--mirror \
79+
--no-parent \
80+
--relative \
81+
--timestamping \
82+
--no-check-certificate \
83+
--recursive \
84+
"https://whatever/some/path"
85+
```
86+
Note ⑴: Although the author typically reaches for `curl`, it lacks a direct mirroring option—hence `wget` here.
87+
88+
Note ⑵: This is mostly a "note-to-self" for the author of this subsection 😉.
89+
90+
6891
## 💁‍♀️ Support
6992

7093
If you are having issues file a bug report in Github: https://github.com/NASA-PDS/deep-archive/issues

src/pds2/aipgen/tests/test_functional.py

Lines changed: 65 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -67,37 +67,6 @@ def getsiteid(self):
6767
return "PDS_ATM"
6868

6969

70-
class LADEESIPWithBadbaseurlTest(LADEESIPTest):
71-
"""This is the test fixture for LADEE SIPs but with bad base URLS."""
72-
73-
def setUp(self):
74-
"""Set up this text fixture."""
75-
super(LADEESIPWithBadbaseurlTest, self).setUp()
76-
from zope.component import provideUtility # type: ignore
77-
from pds2.aipgen.utils import URLValidator
78-
79-
self.validator = URLValidator()
80-
provideUtility(self.validator)
81-
82-
def tearDown(self):
83-
"""Tear down this text fixture."""
84-
del self.validator
85-
super(LADEESIPWithBadbaseurlTest, self).tearDown()
86-
87-
def getbaseurl(self):
88-
"""Get the base URL."""
89-
# This should always be a non-existent path no matter where this test is being run.
90-
# If you go out of your way to actually create this path on your system, please take
91-
# a moment to question your other life choices 🧐
92-
return "file:/definitely/a/non/exist/int/path/prefix/"
93-
94-
# https://github.com/NASA-PDS/pds-deep-archive/issues/102
95-
def test_sip(self):
96-
"""Make sure that the SIP generation fails with a URLError due to a non-existent base URL."""
97-
with self.assertRaises(URLError):
98-
super(LADEESIPWithBadbaseurlTest, self).test_sip()
99-
100-
10170
class LADEEAIPTest(AIPFunctionalTestCase):
10271
"""Test case for AIP generation for all collections from the LADEE test bundle."""
10372

@@ -325,21 +294,77 @@ def getmanifests(self):
325294
return (base + "checksum_manifest_v1.0.tab", base + "transfer_manifest_v1.0.tab")
326295

327296

297+
class NAIF3SIPWithBadbaseurlTest(SIPFunctionalTestCase):
298+
"""This is the test fixture for NAIF3 SIPs but with bad base URLs."""
299+
300+
@classmethod
301+
def setUpClass(cls):
302+
"""Override the abstract base class which just skips itself."""
303+
pass
304+
305+
def getbundlefile(self):
306+
"""Get the bundle file."""
307+
return "data/naif3/bundle_mars2020_spice_v003.xml"
308+
309+
def getallcollectionsflag(self):
310+
"""Get the all collections flag."""
311+
return True
312+
313+
def getvalidsipfilename(self):
314+
"""Get the valid SIP file name.
315+
316+
This doesn't really matter because the goal is to raise a URLError when the SIP
317+
is generated.
318+
"""
319+
return "does/not/matter.tab"
320+
321+
def getsiteid(self):
322+
"""Get the site ID."""
323+
return "PDS_ATM"
324+
325+
def setUp(self):
326+
"""Set up this text fixture."""
327+
super().setUp()
328+
from zope.component import provideUtility # type: ignore
329+
from pds2.aipgen.utils import URLValidator
330+
331+
self.validator = URLValidator()
332+
provideUtility(self.validator)
333+
334+
def tearDown(self):
335+
"""Tear down this text fixture."""
336+
del self.validator
337+
super().tearDown()
338+
339+
def getbaseurl(self):
340+
"""Get the base URL."""
341+
# This should always be a non-existent path no matter where this test is being run.
342+
# If you go out of your way to actually create this path on your system, please take
343+
# a moment to question your other life choices 🧐
344+
return "file:/definitely/a/non/exist/int/path/prefix/"
345+
346+
# https://github.com/NASA-PDS/pds-deep-archive/issues/102
347+
def test_sip(self):
348+
"""Make sure that the SIP generation fails with a URLError due to a non-existent base URL."""
349+
with self.assertRaises(URLError):
350+
super().test_sip()
351+
352+
328353
def test_suite():
329354
"""Return a suite of tests, duh flake8."""
330355
return unittest.TestSuite(
331356
[
332-
unittest.defaultTestLoader.loadTestsFromTestCase(LADEESIPTest),
333-
unittest.defaultTestLoader.loadTestsFromTestCase(LADEEAIPTest),
334-
unittest.defaultTestLoader.loadTestsFromTestCase(SensitivitySIPTest),
335-
unittest.defaultTestLoader.loadTestsFromTestCase(SensitivityAIPTest),
336-
unittest.defaultTestLoader.loadTestsFromTestCase(InsightAllSIPTest),
357+
unittest.defaultTestLoader.loadTestsFromTestCase(DuplicateTabFileTest),
337358
unittest.defaultTestLoader.loadTestsFromTestCase(InsightAllAIPTest),
338-
unittest.defaultTestLoader.loadTestsFromTestCase(InsightLatestSIPTest),
359+
unittest.defaultTestLoader.loadTestsFromTestCase(InsightAllSIPTest),
339360
unittest.defaultTestLoader.loadTestsFromTestCase(InsightLatestAIPTest),
340-
unittest.defaultTestLoader.loadTestsFromTestCase(SecondaryCollectionSIPTest),
361+
unittest.defaultTestLoader.loadTestsFromTestCase(InsightLatestSIPTest),
362+
unittest.defaultTestLoader.loadTestsFromTestCase(LADEEAIPTest),
363+
unittest.defaultTestLoader.loadTestsFromTestCase(LADEESIPTest),
364+
unittest.defaultTestLoader.loadTestsFromTestCase(NAIF3SIPWithBadbaseurlTest),
341365
unittest.defaultTestLoader.loadTestsFromTestCase(SecondaryCollectionAIPTest),
342-
unittest.defaultTestLoader.loadTestsFromTestCase(LADEESIPWithBadbaseurlTest),
343-
unittest.defaultTestLoader.loadTestsFromTestCase(DuplicateTabFileTest),
366+
unittest.defaultTestLoader.loadTestsFromTestCase(SecondaryCollectionSIPTest),
367+
unittest.defaultTestLoader.loadTestsFromTestCase(SensitivityAIPTest),
368+
unittest.defaultTestLoader.loadTestsFromTestCase(SensitivitySIPTest),
344369
]
345370
)
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<?xml-model href="http://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1500.sch"
3+
schematypens="http://purl.oclc.org/dsdl/schematron"?>
4+
5+
<Product_Bundle xmlns="http://pds.nasa.gov/pds4/pds/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pds.nasa.gov/pds4/pds/v1 http://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1500.xsd">
6+
<Identification_Area>
7+
<logical_identifier>urn:nasa:pds:mars2020.spice</logical_identifier>
8+
<version_id>1.0</version_id>
9+
<title>Mars 2020 Perseverance Rover Mission SPICE Kernel Archive Bundle</title>
10+
<information_model_version>1.5.0.0</information_model_version>
11+
<product_class>Product_Bundle</product_class>
12+
<Citation_Information>
13+
<author_list>Costa Sitja M.; Semenov B. V.; Barnes M. J.</author_list>
14+
<publication_year>2021</publication_year>
15+
<keyword>Observation Geometry</keyword>
16+
<description>This bundle contains Mars 2020 Perseverance Rover Mission SPICE kernels and related documentation.</description>
17+
</Citation_Information>
18+
</Identification_Area>
19+
<Context_Area>
20+
<Time_Coordinates>
21+
<start_date_time>2020-07-30T12:51:34Z</start_date_time>
22+
<stop_date_time>2021-05-21T15:47:08Z</stop_date_time>
23+
</Time_Coordinates>
24+
<Primary_Result_Summary>
25+
<purpose>Observation Geometry</purpose>
26+
<processing_level>Derived</processing_level>
27+
</Primary_Result_Summary>
28+
<Investigation_Area>
29+
<name>Mars 2020 Perseverance Rover Mission</name>
30+
<type>Mission</type>
31+
<Internal_Reference>
32+
<lid_reference>urn:nasa:pds:context:investigation:mission.mars2020</lid_reference>
33+
<reference_type>bundle_to_investigation</reference_type>
34+
</Internal_Reference>
35+
</Investigation_Area>
36+
<Observing_System>
37+
<Observing_System_Component>
38+
<name>Mars 2020 Perseverance Rover</name>
39+
<type>Spacecraft</type>
40+
<Internal_Reference>
41+
<lid_reference>urn:nasa:pds:context:instrument_host:spacecraft.mars2020</lid_reference>
42+
<reference_type>is_instrument_host</reference_type>
43+
</Internal_Reference>
44+
</Observing_System_Component>
45+
</Observing_System>
46+
<Target_Identification>
47+
<name>MARS</name>
48+
<type>Planet</type>
49+
<Internal_Reference>
50+
<lid_reference>urn:nasa:pds:context:target:planet.mars</lid_reference>
51+
<reference_type>bundle_to_target</reference_type>
52+
</Internal_Reference>
53+
</Target_Identification>
54+
</Context_Area>
55+
<Reference_List>
56+
<Internal_Reference>
57+
<lid_reference>urn:nasa:pds:mars2020.spice:document:spiceds</lid_reference>
58+
<reference_type>bundle_to_document</reference_type>
59+
</Internal_Reference>
60+
</Reference_List>
61+
<Bundle>
62+
<bundle_type>Archive</bundle_type>
63+
<description>This bundle contains Mars 2020 Perseverance Rover Mission SPICE kernels and related documentation.</description>
64+
</Bundle>
65+
<File_Area_Text>
66+
<File>
67+
<file_name>readme.txt</file_name>
68+
<creation_date_time>2021-08-20T11:52:01</creation_date_time>
69+
<file_size unit="byte">1365</file_size>
70+
<md5_checksum>03fb547e38c7f87d33d48123ae01d8b2</md5_checksum>
71+
</File>
72+
<Stream_Text>
73+
<offset unit="byte">0</offset>
74+
<parsing_standard_id>7-Bit ASCII Text</parsing_standard_id>
75+
<record_delimiter>Carriage-Return Line-Feed</record_delimiter>
76+
</Stream_Text>
77+
</File_Area_Text>
78+
<Bundle_Member_Entry>
79+
<lidvid_reference>urn:nasa:pds:mars2020.spice:spice_kernels::1.0</lidvid_reference>
80+
<member_status>Primary</member_status>
81+
<reference_type>bundle_has_spice_kernel_collection</reference_type>
82+
</Bundle_Member_Entry>
83+
<Bundle_Member_Entry>
84+
<lidvid_reference>urn:nasa:pds:mars2020.spice:document::1.0</lidvid_reference>
85+
<member_status>Primary</member_status>
86+
<reference_type>bundle_has_document_collection</reference_type>
87+
</Bundle_Member_Entry>
88+
</Product_Bundle>

0 commit comments

Comments
 (0)