11 import arvados.collection
14 from arvados_cwl.fsaccess import CollectionFetcher
16 class TestUrljoin(unittest.TestCase):
17 def test_urljoin(self):
18 """Test path joining for keep references."""
20 cf = CollectionFetcher({}, None)
22 self.assertEquals("keep:99999999999999999999999999999991+99/hw.py",
23 cf.urljoin("keep:99999999999999999999999999999991+99", "hw.py"))
25 self.assertEquals("keep:99999999999999999999999999999991+99/hw.py",
26 cf.urljoin("keep:99999999999999999999999999999991+99/", "hw.py"))
28 self.assertEquals("keep:99999999999999999999999999999991+99/hw.py#main",
29 cf.urljoin("keep:99999999999999999999999999999991+99", "hw.py#main"))
31 self.assertEquals("keep:99999999999999999999999999999991+99/hw.py#main",
32 cf.urljoin("keep:99999999999999999999999999999991+99/hw.py", "#main"))
34 self.assertEquals("keep:99999999999999999999999999999991+99/dir/hw.py#main",
35 cf.urljoin("keep:99999999999999999999999999999991+99/dir/hw.py", "#main"))
37 self.assertEquals("keep:99999999999999999999999999999991+99/dir/wh.py",
38 cf.urljoin("keep:99999999999999999999999999999991+99/dir/hw.py", "wh.py"))
40 self.assertEquals("keep:99999999999999999999999999999991+99/wh.py",
41 cf.urljoin("keep:99999999999999999999999999999991+99/dir/hw.py", "/wh.py"))
43 self.assertEquals("keep:99999999999999999999999999999991+99/wh.py#main",
44 cf.urljoin("keep:99999999999999999999999999999991+99/dir/hw.py", "/wh.py#main"))
46 self.assertEquals("keep:99999999999999999999999999999991+99/wh.py",
47 cf.urljoin("keep:99999999999999999999999999999991+99/hw.py#main", "wh.py"))
49 self.assertEquals("keep:99999999999999999999999999999992+99",
50 cf.urljoin("keep:99999999999999999999999999999991+99", "keep:99999999999999999999999999999992+99"))
52 self.assertEquals("keep:99999999999999999999999999999991+99/dir/wh.py",
53 cf.urljoin("keep:99999999999999999999999999999991+99/dir/", "wh.py"))
55 def test_resolver(self):