Ejemplo n.º 1
0
    def test_check_mirror_check_only(self):
        pkg = webports.source_package.create_package("zlib")
        pkg.get_archive_filename = Mock(return_value="file.tar.gz")
        options = Mock()
        options.check = True
        update_mirror.check_mirror(options, pkg, ["file.tar.gz"])

        with self.assertRaises(SystemExit):
            update_mirror.check_mirror(options, pkg, [])
Ejemplo n.º 2
0
    def test_check_mirror_check_only(self):
        pkg = webports.source_package.create_package('zlib')
        pkg.get_archive_filename = Mock(return_value='file.tar.gz')
        options = Mock()
        options.check = True
        update_mirror.check_mirror(options, pkg, ['file.tar.gz'])

        with self.assertRaises(SystemExit):
            update_mirror.check_mirror(options, pkg, [])
Ejemplo n.º 3
0
    def test_check_mirror_with_download(self, upload_mock):
        mock_download = Mock()
        pkg = webports.source_package.create_package("zlib")
        pkg.download = mock_download

        pkg.get_archive_filename = Mock(return_value="file.tar.gz")
        options = Mock()
        options.check = False
        update_mirror.check_mirror(options, pkg, ["file.tar.gz"])
        update_mirror.check_mirror(options, pkg, [])

        upload_mock.assert_called_once_with(options, pkg.download_location(), update_mirror.MIRROR_GS + "/file.tar.gz")
Ejemplo n.º 4
0
    def test_check_mirror_with_download(self, upload_mock):
        mock_download = Mock()
        pkg = webports.source_package.create_package('zlib')
        pkg.download = mock_download

        pkg.get_archive_filename = Mock(return_value='file.tar.gz')
        options = Mock()
        options.check = False
        update_mirror.check_mirror(options, pkg, ['file.tar.gz'])
        update_mirror.check_mirror(options, pkg, [])

        upload_mock.assert_called_once_with(
            options, pkg.download_location(),
            update_mirror.MIRROR_GS + '/file.tar.gz')