[Piglit] [PATCH 11/11] framework: rename profile.loadTestProfile to profile.load_test_profile
Dylan Baker
baker.dylan.c at gmail.com
Fri Apr 25 13:27:43 PDT 2014
This is a more pythonic name for this method.
This patch was created with the following shell command:
find . -name '*py' | \
xargs sed -i -e 's!loadTestProfile!load_test_profile!g'
---
framework/profile.py | 8 ++++----
framework/tests/profile_tests.py | 8 ++++----
piglit-print-commands.py | 2 +-
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/framework/profile.py b/framework/profile.py
index 4777c60..affd4b6 100644
--- a/framework/profile.py
+++ b/framework/profile.py
@@ -39,7 +39,7 @@ import framework.exectest
__all__ = [
'TestProfile',
- 'loadTestProfile',
+ 'load_test_profile',
'merge_test_profiles'
]
@@ -259,7 +259,7 @@ class TestProfile(object):
self.test_list.update(profile.test_list)
-def loadTestProfile(filename):
+def load_test_profile(filename):
""" Load a python module and return it's profile attribute
All of the python test files provide a profile attribute which is a
@@ -295,7 +295,7 @@ def merge_test_profiles(profiles):
profiles -- a list of one or more paths to profile files.
"""
- profile = loadTestProfile(profiles.pop())
+ profile = load_test_profile(profiles.pop())
for p in profiles:
- profile.update(TestProfile(p))
+ profile.update(load_test_profile(p))
return profile
diff --git a/framework/tests/profile_tests.py b/framework/tests/profile_tests.py
index 94354ad..de4730f 100644
--- a/framework/tests/profile_tests.py
+++ b/framework/tests/profile_tests.py
@@ -38,17 +38,17 @@ def test_initialize_testprofile():
def test_load_test_profile_no_profile():
""" Loading a module with no profile name exits
- Beacuse loadTestProfile uses test.{} to load a module we need a module in
+ Beacuse load_test_profile uses test.{} to load a module we need a module in
tests that doesn't have a profile attribute. The only module that currently
meets that requirement is __init__.py
"""
- profile.loadTestProfile('__init__')
+ profile.load_test_profile('__init__')
def test_load_test_profile_returns():
- """ loadTestProfile returns a TestProfile instance """
- profile_ = profile.loadTestProfile('sanity')
+ """ load_test_profile returns a TestProfile instance """
+ profile_ = profile.load_test_profile('sanity')
assert isinstance(profile_, profile.TestProfile)
diff --git a/piglit-print-commands.py b/piglit-print-commands.py
index 547d964..757fe3a 100755
--- a/piglit-print-commands.py
+++ b/piglit-print-commands.py
@@ -61,7 +61,7 @@ def main():
piglit_dir = path.dirname(path.realpath(sys.argv[0]))
os.chdir(piglit_dir)
- profile = framework.profile.loadTestProfile(args.testProfile)
+ profile = framework.profile.load_test_profile(args.testProfile)
def getCommand(test):
command = ''
--
2.0.0.rc0
More information about the Piglit
mailing list