diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-04-17 09:43:03 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-04-17 09:43:03 -0500 |
commit | cb8ea0fe3f44f21c13e16f8d6363f56f31c52b27 (patch) | |
tree | 6ae0bb4be1a7aef42c4d2f34adb8c2f3c5cff160 /mediagoblin/tests | |
parent | 904f61c2988af2e27701a9ea47140abab12624aa (diff) | |
download | mediagoblin-cb8ea0fe3f44f21c13e16f8d6363f56f31c52b27.tar.lz mediagoblin-cb8ea0fe3f44f21c13e16f8d6363f56f31c52b27.tar.xz mediagoblin-cb8ea0fe3f44f21c13e16f8d6363f56f31c52b27.zip |
Moved app.load_controller -> util.import_component and added tests.
Diffstat (limited to 'mediagoblin/tests')
-rw-r--r-- | mediagoblin/tests/test_util.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/mediagoblin/tests/test_util.py b/mediagoblin/tests/test_util.py new file mode 100644 index 00000000..0e7a2967 --- /dev/null +++ b/mediagoblin/tests/test_util.py @@ -0,0 +1,30 @@ +# GNU MediaGoblin -- federated, autonomous media hosting +# Copyright (C) 2011 Free Software Foundation, Inc +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +from mediagoblin import util + + +def _import_component_testing_method(silly_string): + # Just for the sake of testing that our component importer works. + return u"'%s' is the silliest string I've ever seen" % silly_string + + +def test_import_component(): + imported_func = util.import_component( + 'mediagoblin.tests.test_util:_import_component_testing_method') + result = imported_func('hooobaladoobala') + expected = u"'hooobaladoobala' is the silliest string I've ever seen" + assert result == expected |