Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change from_python() to from_module()

  • Loading branch information...
commit 103bf6e2f987e6cdf7cc2b0ee8f317955100ad0c 1 parent 6211880
Sean Lynch authored
Showing with 5 additions and 5 deletions.
  1. +1 −1  src/flask_assets.py
  2. +4 −4 tests/test_env.py
2  src/flask_assets.py
View
@@ -211,7 +211,7 @@ def from_yaml(self, path):
bundles = YAMLLoader(path).load_bundles()
[self.register(name, bundle) for name, bundle in bundles.iteritems()]
- def from_python(self, path):
+ def from_module(self, path):
"""Register bundles from a Python module"""
bundles = PythonLoader(path).load_bundles()
[self.register(name, bundle) for name, bundle in bundles.iteritems()]
8 tests/test_env.py
View
@@ -23,7 +23,7 @@ def test_tag_available(self):
assert t.render() == '/foo/file1;/foo/file2;'
def test_from_yaml(self):
- """Test that a yaml configuration gets loaded
+ """YAML configuration gets loaded
"""
f = open('test.yaml', 'w')
f.write("""
@@ -41,14 +41,14 @@ def test_from_yaml(self):
os.remove('test.yaml')
- def test_from_python(self):
- """Test that a python configuration gets loaded
+ def test_from_python_module(self):
+ """Python configuration module gets loaded
"""
import types
module = types.ModuleType('test')
module.pytest = Bundle('pyfile1', 'pyfile2')
- self.env.from_python(module)
+ self.env.from_module(module)
t = self.app.jinja_env.from_string('{% assets "pytest" %}{{ASSET_URL}};{% endassets %}')
assert t.render() == '/foo/pyfile1;/foo/pyfile2;'
Please sign in to comment.
Something went wrong with that request. Please try again.