コード例 #1
0
 def test_parse_local_source_string(self):
     """Parsing location source string. Verify tuple is parsed as anticipated."""
     (source, uri, location, options) = Path.parse({'path': 'src/foo/bar'})
     self.assertEqual(source, 'local')
     self.assertEqual(location, 'src/foo/bar')
     self.assertEqual(uri, '')
     self.assertEqual(options, {})
コード例 #2
0
 def test_parse_local_source_string(self):
     """Parsing location source string. Verify tuple is parsed as anticipated."""
     source, uri, location, options = Path.parse({"path": "src/foo/bar"})
     self.assertEqual(source, "local")
     self.assertEqual(location, "src/foo/bar")
     self.assertEqual(uri, "")
     self.assertEqual(options, {})
コード例 #3
0
 def test_parse_git_source_with_location_no_options(self):
     """Parsing Git source with location, no options. Verify tuple is parsed as anticipated."""
     (source, uri, location, options) = Path.parse(
         {'path': 'git::git://github.com/onicagroup/foo/bar.git//foo/bar'})
     self.assertEqual(source, 'git')
     self.assertEqual(location, 'foo/bar')
     self.assertEqual(uri, 'git://github.com/onicagroup/foo/bar.git')
     self.assertEqual(options, {})
コード例 #4
0
 def test_parse_git_source_with_location_no_options(self):
     """Parsing Git source with location, no options. Verify tuple is parsed as anticipated."""
     source, uri, location, options = Path.parse(
         {"path": "git::git://github.com/onicagroup/foo/bar.git//foo/bar"})
     self.assertEqual(source, "git")
     self.assertEqual(location, "foo/bar")
     self.assertEqual(uri, "git://github.com/onicagroup/foo/bar.git")
     self.assertEqual(options, {})
コード例 #5
0
    def test_parse_git_source_with_multiple_options_and_location(self):
        """Parsing Git source with multiple options and location.

        Verify tuple is parsed as anticipated.

        """
        path = 'git::git://github.com/onicagroup/foo/bar.git//src/foo/bar?branch=foo&bar=baz'
        (source, uri, location, options) = Path.parse({'path': path})
        self.assertEqual(source, 'git')
        self.assertEqual(location, 'src/foo/bar')
        self.assertEqual(uri, 'git://github.com/onicagroup/foo/bar.git')
        self.assertEqual(options, {'branch': 'foo', 'bar': 'baz'})
コード例 #6
0
    def test_parse_git_source_with_multiple_options_and_location(self):
        """Parsing Git source with multiple options and location.

        Verify tuple is parsed as anticipated.

        """
        path = "git::git://github.com/onicagroup/foo/bar.git//src/foo/bar?branch=foo&bar=baz"
        source, uri, location, options = Path.parse({"path": path})
        self.assertEqual(source, "git")
        self.assertEqual(location, "src/foo/bar")
        self.assertEqual(uri, "git://github.com/onicagroup/foo/bar.git")
        self.assertEqual(options, {"branch": "foo", "bar": "baz"})
コード例 #7
0
    def test_parse_git_source_with_options_no_location(self):
        """
        Parsing Git source with options, no location.

        Verify tuple is parsed as anticipated.
        """
        (source, uri, location, options) = Path.parse({
            'path':
            'git::git://github.com/onicagroup/foo/bar.git?branch=foo'
        })
        self.assertEqual(source, 'git')
        self.assertEqual(location, '')
        self.assertEqual(uri, 'git://github.com/onicagroup/foo/bar.git')
        self.assertEqual(options, {'branch': 'foo'})
コード例 #8
0
    def test_parse_git_source_with_options_no_location(self):
        """Parsing Git source with options, no location.

        Verify tuple is parsed as anticipated.

        """
        source, uri, location, options = Path.parse({
            "path":
            "git::git://github.com/onicagroup/foo/bar.git?branch=foo"
        })
        self.assertEqual(source, "git")
        self.assertEqual(location, "")
        self.assertEqual(uri, "git://github.com/onicagroup/foo/bar.git")
        self.assertEqual(options, {"branch": "foo"})