8000 Change from_python() to from_module() · woodcoder/flask-assets@103bf6e · GitHub
[go: up one dir, main page]

Skip to content

Commit 103bf6e

8000 Browse files
author
Sean Lynch
committed
Change from_python() to from_module()
1 parent 6211880 commit 103bf6e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/flask_assets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def from_yaml(self, path):
211211
bundles = YAMLLoader(path).load_bundles()
212212
[self.register(name, bundle) for name, bundle in bundles.iteritems()]
213213

214-
def from_python(self, path):
214+
def from_module(self, path):
215215
"""Register bundles from a Python module"""
216216
bundles = PythonLoader(path).load_bundles()
217217
[self.register(name, bundle) for name, bundle in bundles.iteritems()]

tests/test_env.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_tag_available(self):
2323
assert t.render() == '/foo/file1;/foo/file2;'
2424

2525
def test_from_yaml(self):
26-
"""Test that a yaml configuration gets loaded
26+
"""YAML configuration gets loaded
2727
"""
2828
f = open('test.yaml', 'w')
2929
f.write("""
@@ -41,14 +41,14 @@ def test_from_yaml(self):
4141

4242
os.remove('test.yaml')
4343

44-
def test_from_python(self):
45-
"""Test that a python configuration gets loaded
44+
def test_from_python_module(self):
45+
"""Python configuration module gets loaded
4646
"""
4747
import types
4848
module = types.ModuleType('test')
4949
module.pytest = Bundle('pyfile1', 'pyfile2')
5050

51-
self.env.from_python(module)
51+
self.env.from_module(module)
5252

5353
t = self.app.jinja_env.from_string('{% assets "pytest" %}{{ASSET_URL}};{% endassets %}')
5454
assert t.render() == '/foo/pyfile1;/foo/pyfile2;'

0 commit comments

Comments
 (0)
0