Return-Path: X-Original-To: apmail-incubator-bloodhound-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-bloodhound-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B65FBEE3D for ; Mon, 18 Feb 2013 15:32:29 +0000 (UTC) Received: (qmail 64005 invoked by uid 500); 18 Feb 2013 15:32:29 -0000 Delivered-To: apmail-incubator-bloodhound-commits-archive@incubator.apache.org Received: (qmail 63975 invoked by uid 500); 18 Feb 2013 15:32:29 -0000 Mailing-List: contact bloodhound-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: bloodhound-dev@incubator.apache.org Delivered-To: mailing list bloodhound-commits@incubator.apache.org Received: (qmail 63963 invoked by uid 99); 18 Feb 2013 15:32:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Feb 2013 15:32:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Feb 2013 15:32:28 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 4296223889CB; Mon, 18 Feb 2013 15:32:09 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1447328 - /incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/mimeview/patch.py Date: Mon, 18 Feb 2013 15:32:09 -0000 To: bloodhound-commits@incubator.apache.org From: jure@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130218153209.4296223889CB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jure Date: Mon Feb 18 15:32:08 2013 New Revision: 1447328 URL: http://svn.apache.org/r1447328 Log: #355, patch renderer test cases, patch t355_r1446579_trac_test_mimeview_patch.diff applied (from Olemis) Added: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/mimeview/patch.py Added: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/mimeview/patch.py URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/mimeview/patch.py?rev=1447328&view=auto ============================================================================== --- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/mimeview/patch.py (added) +++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/tests/mimeview/patch.py Mon Feb 18 15:32:08 2013 @@ -0,0 +1,67 @@ + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +"""Tests for Apache(TM) Bloodhound's patch renderer in product environments""" + +import unittest + +from trac.mimeview.api import Mimeview +from trac.mimeview.patch import PatchRenderer +from trac.mimeview.tests.patch import PatchRendererTestCase +from trac.web.chrome import Chrome + +from multiproduct.env import ProductEnvironment +from tests.env import MultiproductTestCase + +class ProductPatchRendererTestCase(PatchRendererTestCase, MultiproductTestCase): + + @property + def env(self): + env = getattr(self, '_env', None) + if env is None: + self.global_env = self._setup_test_env( + enable=[Chrome, PatchRenderer] + ) + self._upgrade_mp(self.global_env) + self._setup_test_log(self.global_env) + self._load_product_from_data(self.global_env, self.default_product) + self._env = env = ProductEnvironment( + self.global_env, self.default_product) + return env + + @env.setter + def env(self, value): + pass + + def setUp(self): + PatchRendererTestCase.setUp(self) + self.patch = Mimeview(self.env).renderers[0] + + def tearDown(self): + self.global_env.reset_db() + self.global_env = self._env = None + + +def test_suite(): + return unittest.TestSuite([ + unittest.makeSuite(ProductPatchRendererTestCase,'test'), + ]) + +if __name__ == '__main__': + unittest.main(defaultTest='test_suite') +