13135: Add secrets test to arvados-tests
[arvados.git] / sdk / cwl / tests / test_urljoin.py
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: Apache-2.0
4
5 import functools
6 import mock
7 import sys
8 import unittest
9 import json
10 import logging
11 import os
12
13 import arvados
14 import arvados.keep
15 import arvados.collection
16 import arvados_cwl
17
18 from arvados_cwl.fsaccess import CollectionFetcher
19
20 class TestUrljoin(unittest.TestCase):
21     def test_urljoin(self):
22         """Test path joining for keep references."""
23
24         cf = CollectionFetcher({}, None)
25
26         self.assertEquals("keep:99999999999999999999999999999991+99/hw.py",
27                           cf.urljoin("keep:99999999999999999999999999999991+99", "hw.py"))
28
29         self.assertEquals("keep:99999999999999999999999999999991+99/hw.py",
30                           cf.urljoin("keep:99999999999999999999999999999991+99/", "hw.py"))
31
32         self.assertEquals("keep:99999999999999999999999999999991+99/hw.py#main",
33                           cf.urljoin("keep:99999999999999999999999999999991+99", "hw.py#main"))
34
35         self.assertEquals("keep:99999999999999999999999999999991+99/hw.py#main",
36                           cf.urljoin("keep:99999999999999999999999999999991+99/hw.py", "#main"))
37
38         self.assertEquals("keep:99999999999999999999999999999991+99/dir/hw.py#main",
39                           cf.urljoin("keep:99999999999999999999999999999991+99/dir/hw.py", "#main"))
40
41         self.assertEquals("keep:99999999999999999999999999999991+99/dir/wh.py",
42                           cf.urljoin("keep:99999999999999999999999999999991+99/dir/hw.py", "wh.py"))
43
44         self.assertEquals("keep:99999999999999999999999999999991+99/wh.py",
45                           cf.urljoin("keep:99999999999999999999999999999991+99/dir/hw.py", "/wh.py"))
46
47         self.assertEquals("keep:99999999999999999999999999999991+99/wh.py#main",
48                           cf.urljoin("keep:99999999999999999999999999999991+99/dir/hw.py", "/wh.py#main"))
49
50         self.assertEquals("keep:99999999999999999999999999999991+99/wh.py",
51                           cf.urljoin("keep:99999999999999999999999999999991+99/hw.py#main", "wh.py"))
52
53         self.assertEquals("keep:99999999999999999999999999999992+99",
54                           cf.urljoin("keep:99999999999999999999999999999991+99", "keep:99999999999999999999999999999992+99"))
55
56         self.assertEquals("keep:99999999999999999999999999999991+99/dir/wh.py",
57                           cf.urljoin("keep:99999999999999999999999999999991+99/dir/", "wh.py"))
58
59     def test_resolver(self):
60         pass