Beispiel #1
0
 def test_url_local_expand_var(self):
     """verify that a local path with '$HOME' gets expanded to an absolute path.
     """
     field = 'test'
     url = '$HOME/path/to/repo'
     received = expand_local_url(url, field)
     self.assertTrue(os.path.isabs(received))
 def test_url_local_expand_var(self):
     """verify that a local path with '$HOME' gets expanded to an absolute path.
     """
     field = 'test'
     url = '$HOME/path/to/repo'
     received = expand_local_url(url, field)
     self.assertTrue(os.path.isabs(received))
    def test_url_local_env_missing(self):
        """verify that a local path with env var that is missing gets left as-is

        """
        field = 'test'
        url = '$TMP_VAR/path/to/repo'
        received = expand_local_url(url, field)
        print(received)
        self.assertEqual(received, url)
Beispiel #4
0
    def test_url_local_env_missing(self):
        """verify that a local path with env var that is missing gets left as-is

        """
        field = 'test'
        url = '$TMP_VAR/path/to/repo'
        received = expand_local_url(url, field)
        print(received)
        self.assertEqual(received, url)
    def test_url_local_normalize_rel(self):
        """verify that a local path with another env var gets expanded to an
        absolute path.

        """
        field = 'test'
        url = '/this/is/a/long/../path/to/a/repo'
        received = expand_local_url(url, field)
        print(received)
        self.assertEqual(received, '/this/is/a/path/to/a/repo')
Beispiel #6
0
    def test_url_local_normalize_rel(self):
        """verify that a local path with another env var gets expanded to an
        absolute path.

        """
        field = 'test'
        url = '/this/is/a/long/../path/to/a/repo'
        received = expand_local_url(url, field)
        print(received)
        self.assertEqual(received, '/this/is/a/path/to/a/repo')
    def test_url_local_expand_env(self):
        """verify that a local path with another env var gets expanded to an
        absolute path.

        """
        field = 'test'
        os.environ['TMP_VAR'] = '/some/absolute'
        url = '$TMP_VAR/path/to/repo'
        received = expand_local_url(url, field)
        del os.environ['TMP_VAR']
        print(received)
        self.assertTrue(os.path.isabs(received))
        self.assertEqual(received, '/some/absolute/path/to/repo')
Beispiel #8
0
    def test_url_local_expand_env(self):
        """verify that a local path with another env var gets expanded to an
        absolute path.

        """
        field = 'test'
        os.environ['TMP_VAR'] = '/some/absolute'
        url = '$TMP_VAR/path/to/repo'
        received = expand_local_url(url, field)
        del os.environ['TMP_VAR']
        print(received)
        self.assertTrue(os.path.isabs(received))
        self.assertEqual(received, '/some/absolute/path/to/repo')
    def test_url_local_user1(self):
        """verify that a local path with '~/path/to/repo' gets expanded to an
        absolute path.

        NOTE(bja, 2017-11) we can't test for something like:
        '~user/path/to/repo' because the user has to be in the local
        machine password directory and we don't know a user name that
        is valid on every system....?

        """
        field = 'test'
        url = '~/path/to/repo'
        received = expand_local_url(url, field)
        print(received)
        self.assertTrue(os.path.isabs(received))
Beispiel #10
0
    def test_url_local_user1(self):
        """verify that a local path with '~/path/to/repo' gets expanded to an
        absolute path.

        NOTE(bja, 2017-11) we can't test for something like:
        '~user/path/to/repo' because the user has to be in the local
        machine password directory and we don't know a user name that
        is valid on every system....?

        """
        field = 'test'
        url = '~/path/to/repo'
        received = expand_local_url(url, field)
        print(received)
        self.assertTrue(os.path.isabs(received))