incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject git commit: [#6388] fix location lookup of tests that explicitly use test.ini
Date Thu, 02 Jan 2014 17:17:59 GMT
Updated Branches:
  refs/heads/master 1bb460c6e -> 58ab8ee83


[#6388] fix location lookup of tests that explicitly use test.ini


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/58ab8ee8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/58ab8ee8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/58ab8ee8

Branch: refs/heads/master
Commit: 58ab8ee836995387695cccb93cd1883cab3600e7
Parents: 1bb460c
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Thu Jan 2 17:10:17 2014 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Thu Jan 2 17:10:17 2014 +0000

----------------------------------------------------------------------
 Allura/allura/tests/test_commands.py                      |  8 +++++---
 ForgeBlog/forgeblog/tests/test_commands.py                | 10 ++++------
 .../forgetracker/tests/command/test_fix_discussion.py     |  4 +++-
 3 files changed, 12 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/58ab8ee8/Allura/allura/tests/test_commands.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_commands.py b/Allura/allura/tests/test_commands.py
index b290380..5187d14 100644
--- a/Allura/allura/tests/test_commands.py
+++ b/Allura/allura/tests/test_commands.py
@@ -20,6 +20,7 @@ from datadiff.tools import assert_equal
 from ming.orm import ThreadLocalORMSession
 from mock import Mock, call, patch
 import pymongo
+import pkg_resources
 
 from alluratest.controller import setup_basic_test, setup_global_objects
 from allura.command import base, script, set_neighborhood_features, \
@@ -29,7 +30,8 @@ from forgeblog import model as BM
 from allura.lib.exceptions import InvalidNBFeatureValueError
 from allura.tests import decorators as td
 
-test_config = 'test.ini#main'
+test_config = pkg_resources.resource_filename('allura', '../test.ini') + '#main'
+
 
 class EmptyClass(object): pass
 
@@ -41,8 +43,8 @@ def setUp(self):
 
 def test_script():
     cmd = script.ScriptCommand('script')
-    cmd.run([test_config, 'allura/tests/tscript.py' ])
-    assert_raises(ValueError, cmd.run, [test_config, 'allura/tests/tscript_error.py' ])
+    cmd.run([test_config, pkg_resources.resource_filename('allura', 'tests/tscript.py') ])
+    assert_raises(ValueError, cmd.run, [test_config, pkg_resources.resource_filename('allura','tests/tscript_error.py')
])
 
 def test_set_neighborhood_max_projects():
     neighborhood = M.Neighborhood.query.find().first()

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/58ab8ee8/ForgeBlog/forgeblog/tests/test_commands.py
----------------------------------------------------------------------
diff --git a/ForgeBlog/forgeblog/tests/test_commands.py b/ForgeBlog/forgeblog/tests/test_commands.py
index 0b2804a..569470e 100644
--- a/ForgeBlog/forgeblog/tests/test_commands.py
+++ b/ForgeBlog/forgeblog/tests/test_commands.py
@@ -18,22 +18,20 @@
 from datetime import datetime, timedelta
 from pylons import tmpl_context as c, app_globals as g
 from datadiff.tools import assert_equal
-
 from IPython.testing.decorators import module_not_available, skipif
+import pkg_resources
+import mock
+import feedparser
 
 from ming.orm.ormsession import ThreadLocalORMSession
 
 from alluratest.controller import setup_basic_test, setup_global_objects
 from allura import model as M
-from allura.lib import security
-from allura.lib import helpers as h
 from forgeblog import model as BM
 
-import mock
 
-import feedparser
+test_config = pkg_resources.resource_filename('allura', '../test.ini') + '#main'
 
-test_config = 'test.ini#main'
 
 def setUp():
     setup_basic_test()

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/58ab8ee8/ForgeTracker/forgetracker/tests/command/test_fix_discussion.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/command/test_fix_discussion.py b/ForgeTracker/forgetracker/tests/command/test_fix_discussion.py
index 330146f..d0cc4d3 100644
--- a/ForgeTracker/forgetracker/tests/command/test_fix_discussion.py
+++ b/ForgeTracker/forgetracker/tests/command/test_fix_discussion.py
@@ -17,6 +17,7 @@
 
 from ming.orm import session
 from nose.tools import assert_equal, assert_not_equal
+import pkg_resources
 
 from alluratest.controller import setup_basic_test, setup_global_objects
 from forgetracker.command import fix_discussion
@@ -24,7 +25,8 @@ from allura.tests.decorators import with_tracker
 from allura import model as M
 from forgetracker import model as TM
 
-test_config = 'test.ini#main'
+
+test_config = pkg_resources.resource_filename('allura', '../test.ini') + '#main'
 
 
 def setUp(self):


Mime
View raw message