コード例 #1
0
ファイル: test_simple.py プロジェクト: amcfague/pyroxy
    def test_package_list_non_whitelisted(self, mock_filter_index):
        from pyroxy.controllers.simple import config

        package_name = "pylons"
        base_path = "/base/path"

        config._ds['pypi_web_path'] = base_path
        config._ds['whitelisted_packages'] = ()
        mock_filter_index.return_value = sentinel.filter_index

        ret = package_list(package_name)

        self.assertEquals(ret, sentinel.filter_index)
コード例 #2
0
ファイル: test_simple.py プロジェクト: amcfague/pyroxy
    def test_package_list_non_whitelisted(self, mock_filter_index):
        from pyroxy.controllers.simple import config

        package_name = "pylons"
        base_path = "/base/path"

        config._ds['pypi_web_path'] = base_path
        config._ds['whitelisted_packages'] = ()
        mock_filter_index.return_value = sentinel.filter_index

        ret = package_list(package_name)

        self.assertEquals(ret, sentinel.filter_index)
コード例 #3
0
ファイル: test_simple.py プロジェクト: amcfague/pyroxy
    def test_package_list_whitelisted(self, mock_static_file):
        from pyroxy.controllers.simple import config

        package_name = "pylons"
        base_path = "/base/path"

        config._ds['pypi_web_path'] = base_path
        config._ds['whitelisted_packages'] = (package_name,)
        mock_static_file.return_value = sentinel.static_file

        ret = package_list(package_name)

        mock_static_file.assert_called_once_with("index.html",
                root="%s/simple/%s" % (base_path, package_name))
        self.assertEquals(ret, sentinel.static_file)
コード例 #4
0
ファイル: test_simple.py プロジェクト: amcfague/pyroxy
    def test_package_list_whitelisted(self, mock_static_file):
        from pyroxy.controllers.simple import config

        package_name = "pylons"
        base_path = "/base/path"

        config._ds['pypi_web_path'] = base_path
        config._ds['whitelisted_packages'] = (package_name, )
        mock_static_file.return_value = sentinel.static_file

        ret = package_list(package_name)

        mock_static_file.assert_called_once_with("index.html",
                                                 root="%s/simple/%s" %
                                                 (base_path, package_name))
        self.assertEquals(ret, sentinel.static_file)