@@ -14,6 +14,7 @@ using MetaGraphs
1414using RecipesBase
1515using STRIDE_jll
1616
17+ using Downloads
1718using LinearAlgebra
1819using Test
1920
@@ -49,7 +50,8 @@ using BioStructures:
4950 tokenizecifstructure,
5051 formatmmcifcol,
5152 requiresnewline,
52- requiresquote
53+ requiresquote,
54+ pdb_download_prefix
5355
5456# Get the path to BioFmtSpecimens and download it if required
5557fmtdir = BioCore. Testing. get_bio_fmt_specimens (" master" , false )
@@ -90,12 +92,9 @@ Aqua.test_all(BioStructures; ambiguities=(recursive=false))
9092 @test length (pdbentrylist ()) > 100000
9193
9294 # This may be empty on a given date so we just check it has the correct type
93- @test isa (pdbstatuslist (" ftp://ftp.wwpdb.org/pub/pdb /data/status/latest/added.pdb" ), Vector{String})
95+ @test isa (pdbstatuslist (" $pdb_download_prefix /data/status/latest/added.pdb" ), Vector{String})
9496 # Invalid URL
95- # The error type changes from ErrorException to ProcessFailedException in Julia v1.2
96- # therefore we check for the more general Exception type
97- # This also applies to two examples below
98- @test_throws Exception pdbstatuslist (" ftp://ftp.wwpdb.org/pub/pdb/data/status/latest/dummy.pdb" )
97+ @test_throws RequestError pdbstatuslist (" $pdb_download_prefix /data/status/latest/dummy.pdb" )
9998
10099 addedlist, modifiedlist, obsoletelist = pdbrecentchanges ()
101100
@@ -104,13 +103,13 @@ Aqua.test_all(BioStructures; ambiguities=(recursive=false))
104103 # Invalid PDB ID format
105104 @test_throws ArgumentError downloadpdb (" 1a df" )
106105 # Valid PDB ID format but PDB does not exist
107- @test_throws Exception downloadpdb (" no1e" , dir= temp_dir)
106+ @test_throws RequestError downloadpdb (" no1e" , dir= temp_dir)
108107 # Invalid file format
109108 @test_throws TypeError downloadpdb (" 1alw" , dir= temp_dir, format= String)
110109 # Biological assembly not available in PDBXML and MMTF
111110 @test_throws ArgumentError downloadpdb (" 1alw" , dir= temp_dir, format= PDBXMLFormat, ba_number= 1 )
112111 # Invalid BA number for this PDB entry
113- @test_throws Exception downloadpdb (" 1alw" , dir= temp_dir, format= MMCIFFormat, ba_number= 10 )
112+ @test_throws RequestError downloadpdb (" 1alw" , dir= temp_dir, format= MMCIFFormat, ba_number= 10 )
114113 # Test if downloadpdb returns the path to the downloaded file
115114 @test isfile (downloadpdb (" 1crn" , dir= temp_dir))
116115
0 commit comments