Example #1
0
    def test_pull_local_all(self, lib):
        path = '/tmp/path-2'
        path_in = '/tmp/path-1'
        url = 'file://%s' % path_in
        refs = None
        mirror = 0xFF
        depth = 3
        _lib = Mock()
        lib_repo = Mock()
        _lib.GLib.Variant.side_effect = Mock(side_effect=variant)
        _lib.OSTree.RepoPullFlags.MIRROR = mirror
        lib.return_value = _lib

        # test
        repo = Repository(path)
        repo.open = Mock()
        repo.impl = lib_repo
        repo.pull_local(path_in, refs, depth)

        # validation
        options = ('a{sv}', {'depth': ('i', depth), 'flags': ('i', mirror)})
        lib.assert_called_with()
        repo.open.assert_called_once_with()
        lib_repo.pull_with_options.assert_called_once_with(
            url, options, None, None)
Example #2
0
    def test_pull_local_all(self, lib):
        path = '/tmp/path-2'
        path_in = '/tmp/path-1'
        url = 'file://%s' % path_in
        refs = None
        mirror = 0xFF
        depth = 3
        _lib = Mock()
        lib_repo = Mock()
        _lib.GLib.Variant.side_effect = Mock(side_effect=variant)
        _lib.OSTree.RepoPullFlags.MIRROR = mirror
        lib.return_value = _lib

        # test
        repo = Repository(path)
        repo.open = Mock()
        repo.impl = lib_repo
        repo.pull_local(path_in, refs, depth)

        # validation
        options = (
            'a{sv}', {
                'depth': ('i', depth),
                'flags': ('i', mirror)
            })
        lib.assert_called_with()
        repo.open.assert_called_once_with()
        lib_repo.pull_with_options.assert_called_once_with(url, options, None, None)
Example #3
0
    def test_pull_local(self, lib):
        path = '/tmp/path-2'
        path_in = '/tmp/path-1'
        url = 'file://%s' % path_in
        refs = ['branch-1']
        mirror = 'MIRROR'
        _lib = Mock()
        lib_repo = Mock()
        _lib.GLib.Variant.side_effect = Mock(side_effect=variant)
        _lib.OSTree.RepoPullFlags.MIRROR = mirror
        lib.return_value = _lib

        # test
        repo = Repository(path)
        repo.open = Mock()
        repo.impl = lib_repo
        repo.pull_local(path_in, refs)

        # validation
        options = ('a{sv}', {
            'refs': ('as', ('branch-1', )),
            'flags': ('u', 'MIRROR')
        })
        lib.assert_called_with()
        repo.open.assert_called_once_with()
        lib_repo.pull_with_options.assert_called_once_with(
            url, options, None, None)
Example #4
0
    def test_pull_local(self, lib):
        path = '/tmp/path-2'
        path_in = '/tmp/path-1'
        url = 'file://%s' % path_in
        refs = ['branch-1']
        mirror = 'MIRROR'
        _lib = Mock()
        lib_repo = Mock()
        _lib.GLib.Variant.side_effect = Mock(side_effect=variant)
        _lib.OSTree.RepoPullFlags.MIRROR = mirror
        lib.return_value = _lib

        # test
        repo = Repository(path)
        repo.open = Mock()
        repo.impl = lib_repo
        repo.pull_local(path_in, refs)

        # validation
        options = (
            'a{sv}', {
                'refs': ('as', ('branch-1',)),
                'flags': ('u', 'MIRROR')
            })
        lib.assert_called_with()
        repo.open.assert_called_once_with()
        lib_repo.pull_with_options.assert_called_once_with(url, options, None, None)