示例#1
0
 def test_decode_uri(self):
     tests = {
         "/data/local/someDir/PP/COLPEX/COLPEX_16a_pj001.pp": (
             "file",
             "/data/local/someDir/PP/COLPEX/COLPEX_16a_pj001.pp",
         ),
         r"C:\data\local\someDir\PP\COLPEX\COLPEX_16a_pj001.pp": (
             "file",
             r"C:\data\local\someDir\PP\COLPEX\COLPEX_16a_pj001.pp",
         ),
         "file:///data/local/someDir/PP/COLPEX/COLPEX_16a_pj001.pp": (
             "file",
             "///data/local/someDir/PP/COLPEX/COLPEX_16a_pj001.pp",
         ),
         "http://www.somehost.com:8080/resource/thing.grib": (
             "http",
             "//www.somehost.com:8080/resource/thing.grib",
         ),
         "/data/local/someDir/2013-11-25T13:49:17.632797": (
             "file",
             "/data/local/someDir/2013-11-25T13:49:17.632797",
         ),
     }
     for uri, pair in tests.items():
         self.assertEqual(pair, iris.io.decode_uri(uri))
示例#2
0
 def test_decode_uri__str(self):
     tests = {
         (uri := "/data/local/someDir/PP/COLPEX/COLPEX_16a_pj001.pp"): (
             "file",
             uri,
         ),
         (uri := r"C:\data\local\someDir\PP\COLPEX\COLPEX_16a_pj001.pp"): (
             "file",
             uri,
         ),
         (uri := "file:///data/local/someDir/PP/COLPEX/COLPEX_16a_pj001.pp"):
         (
             uri[:4],
             uri[5:],
         ),
         (uri := "http://www.somehost.com:8080/resource/thing.grib"): (
             uri[:4],
             uri[5:],
         ),
         (uri := "/data/local/someDir/2013-11-25T13:49:17.632797"): (
             "file",
             uri,
         ),
     }
     for uri, expected in tests.items():
         self.assertEqual(expected, iris.io.decode_uri(uri))
示例#3
0
 def test_decode_uri(self):
     tests = {
         '/data/local/someDir/PP/COLPEX/COLPEX_16a_pj001.pp':
         ('file', '/data/local/someDir/PP/COLPEX/COLPEX_16a_pj001.pp'),
         'C:\data\local\someDir\PP\COLPEX\COLPEX_16a_pj001.pp':
         ('file', 'C:\data\local\someDir\PP\COLPEX\COLPEX_16a_pj001.pp'),
         'file:///data/local/someDir/PP/COLPEX/COLPEX_16a_pj001.pp':
         ('file', '///data/local/someDir/PP/COLPEX/COLPEX_16a_pj001.pp'),
         'http://www.somehost.com:8080/resource/thing.grib':
         ('http', '//www.somehost.com:8080/resource/thing.grib'),
     }
     for uri, pair in tests.items():
         self.assertEqual(pair, iris.io.decode_uri(uri))
示例#4
0
 def test_decode_uri(self):
     tests = {
         '/data/local/someDir/PP/COLPEX/COLPEX_16a_pj001.pp': (
             'file', '/data/local/someDir/PP/COLPEX/COLPEX_16a_pj001.pp'
         ),
         'C:\data\local\someDir\PP\COLPEX\COLPEX_16a_pj001.pp': (
             'file', 'C:\data\local\someDir\PP\COLPEX\COLPEX_16a_pj001.pp'
         ),
         'file:///data/local/someDir/PP/COLPEX/COLPEX_16a_pj001.pp': (
             'file', '///data/local/someDir/PP/COLPEX/COLPEX_16a_pj001.pp'
         ),
         'http://www.somehost.com:8080/resource/thing.grib': (
             'http', '//www.somehost.com:8080/resource/thing.grib'
         ),
     }
     for uri, pair in tests.items():
         self.assertEqual(pair, iris.io.decode_uri(uri))
示例#5
0
 def test_decode_uri__path(self):
     tests = {
         (uri := "/data/local/someDir/PP/COLPEX/COLPEX_16a_pj001.pp"): (
             "file",
             uri,
         ),
         (uri := r"C:\data\local\someDir\PP\COLPEX\COLPEX_16a_pj001.pp"): (
             "file",
             uri,
         ),
         (uri := "/data/local/someDir/2013-11-25T13:49:17.632797"): (
             "file",
             uri,
         ),
     }
     for uri, expected in tests.items():
         self.assertEqual(expected, iris.io.decode_uri(Path(uri)))
示例#6
0
 def test_decode_uri(self):
     tests = {
         "/data/local/someDir/PP/COLPEX/COLPEX_16a_pj001.pp": (
             "file",
             "/data/local/someDir/PP/COLPEX/COLPEX_16a_pj001.pp",
         ),
         "C:\data\local\someDir\PP\COLPEX\COLPEX_16a_pj001.pp": (
             "file",
             "C:\data\local\someDir\PP\COLPEX\COLPEX_16a_pj001.pp",
         ),
         "file:///data/local/someDir/PP/COLPEX/COLPEX_16a_pj001.pp": (
             "file",
             "///data/local/someDir/PP/COLPEX/COLPEX_16a_pj001.pp",
         ),
         "http://www.somehost.com:8080/resource/thing.grib": ("http", "//www.somehost.com:8080/resource/thing.grib"),
         "/data/local/someDir/2013-11-25T13:49:17.632797": (
             "file",
             "/data/local/someDir/2013-11-25T13:49:17.632797",
         ),
     }
     for uri, pair in tests.items():
         self.assertEqual(pair, iris.io.decode_uri(uri))