public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 1/7] oeqa/utils: replace some tabs with spaces
Date: Tue, 23 Dec 2014 16:08:42 +0000	[thread overview]
Message-ID: <f707823fb4cdfd1f0ce8f4f70fe1ecb0800ddad4.1419350817.git.paul.eggleton@linux.intel.com> (raw)
In-Reply-To: <cover.1419350817.git.paul.eggleton@linux.intel.com>
In-Reply-To: <cover.1419350817.git.paul.eggleton@linux.intel.com>

Python code should use spaces only for indentation.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/lib/oeqa/utils/commands.py   | 10 ++---
 meta/lib/oeqa/utils/decorators.py | 84 +++++++++++++++++++--------------------
 2 files changed, 47 insertions(+), 47 deletions(-)

diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py
index d29c1b1..5b601d9 100644
--- a/meta/lib/oeqa/utils/commands.py
+++ b/meta/lib/oeqa/utils/commands.py
@@ -110,11 +110,11 @@ def runCmd(command, ignore_status=False, timeout=None, assert_error=True, **opti
 def bitbake(command, ignore_status=False, timeout=None, postconfig=None, **options):
 
     if postconfig:
-	postconfig_file = os.path.join(os.environ.get('BUILDDIR'), 'oeqa-post.conf')
-	ftools.write_file(postconfig_file, postconfig)
-	extra_args = "-R %s" % postconfig_file
+        postconfig_file = os.path.join(os.environ.get('BUILDDIR'), 'oeqa-post.conf')
+        ftools.write_file(postconfig_file, postconfig)
+        extra_args = "-R %s" % postconfig_file
     else:
-	extra_args = ""
+        extra_args = ""
 
     if isinstance(command, basestring):
         cmd = "bitbake " + extra_args + " " + command
@@ -122,7 +122,7 @@ def bitbake(command, ignore_status=False, timeout=None, postconfig=None, **optio
         cmd = [ "bitbake" ] + [a for a in (command + extra_args.split(" ")) if a not in [""]]
 
     try:
-	return runCmd(cmd, ignore_status, timeout, **options)
+        return runCmd(cmd, ignore_status, timeout, **options)
     finally:
         if postconfig:
             os.remove(postconfig_file)
diff --git a/meta/lib/oeqa/utils/decorators.py b/meta/lib/oeqa/utils/decorators.py
index 7f845db..1ae1162 100644
--- a/meta/lib/oeqa/utils/decorators.py
+++ b/meta/lib/oeqa/utils/decorators.py
@@ -86,14 +86,14 @@ class testcase(object):
         self.test_case = test_case
 
     def __call__(self, func):
-	def wrapped_f(*args):
-		return func(*args)
-	wrapped_f.test_case = self.test_case
-	return wrapped_f
+        def wrapped_f(*args):
+            return func(*args)
+        wrapped_f.test_case = self.test_case
+        return wrapped_f
 
 class NoParsingFilter(logging.Filter):
     def filter(self, record):
-	return record.levelno == 100
+        return record.levelno == 100
 
 def LogResults(original_class):
     orig_method = original_class.run
@@ -101,51 +101,51 @@ def LogResults(original_class):
     #rewrite the run method of unittest.TestCase to add testcase logging
     def run(self, result, *args, **kws):
         orig_method(self, result, *args, **kws)
-	passed = True
-	testMethod = getattr(self, self._testMethodName)
-
-	#if test case is decorated then use it's number, else use it's name
-	try:
-		test_case = testMethod.test_case
-	except AttributeError:
-		test_case = self._testMethodName
-
-	#create custom logging level for filtering.
-	custom_log_level = 100
-	logging.addLevelName(custom_log_level, 'RESULTS')
-	caller = os.path.basename(sys.argv[0])
-
-	def results(self, message, *args, **kws):
-	    if self.isEnabledFor(custom_log_level):
-		self.log(custom_log_level, message, *args, **kws)
-	logging.Logger.results = results
-
-	logging.basicConfig(filename=os.path.join(os.getcwd(),'results-'+caller+'.log'),
+        passed = True
+        testMethod = getattr(self, self._testMethodName)
+
+        #if test case is decorated then use it's number, else use it's name
+        try:
+            test_case = testMethod.test_case
+        except AttributeError:
+            test_case = self._testMethodName
+
+        #create custom logging level for filtering.
+        custom_log_level = 100
+        logging.addLevelName(custom_log_level, 'RESULTS')
+        caller = os.path.basename(sys.argv[0])
+
+        def results(self, message, *args, **kws):
+            if self.isEnabledFor(custom_log_level):
+                self.log(custom_log_level, message, *args, **kws)
+        logging.Logger.results = results
+
+        logging.basicConfig(filename=os.path.join(os.getcwd(),'results-'+caller+'.log'),
                             filemode='w',
                             format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
                             datefmt='%H:%M:%S',
                             level=custom_log_level)
-	for handler in logging.root.handlers:
-		handler.addFilter(NoParsingFilter())
-	local_log = logging.getLogger(caller)
+        for handler in logging.root.handlers:
+            handler.addFilter(NoParsingFilter())
+        local_log = logging.getLogger(caller)
 
-	#check status of tests and record it
+        #check status of tests and record it
         for (name, msg) in result.errors:
-                if self._testMethodName == str(name).split(' ')[0]:
-			local_log.results("Testcase "+str(test_case)+": ERROR")
-			local_log.results("Testcase "+str(test_case)+":\n"+msg)
-			passed = False
+            if self._testMethodName == str(name).split(' ')[0]:
+                local_log.results("Testcase "+str(test_case)+": ERROR")
+                local_log.results("Testcase "+str(test_case)+":\n"+msg)
+                passed = False
         for (name, msg) in result.failures:
-                if self._testMethodName == str(name).split(' ')[0]:
-			local_log.results("Testcase "+str(test_case)+": FAILED")
-			local_log.results("Testcase "+str(test_case)+":\n"+msg)
-			passed = False
+            if self._testMethodName == str(name).split(' ')[0]:
+                local_log.results("Testcase "+str(test_case)+": FAILED")
+                local_log.results("Testcase "+str(test_case)+":\n"+msg)
+                passed = False
         for (name, msg) in result.skipped:
-                if self._testMethodName == str(name).split(' ')[0]:
-			local_log.results("Testcase "+str(test_case)+": SKIPPED")
-			passed = False
-	if passed:
-			local_log.results("Testcase "+str(test_case)+": PASSED")
+            if self._testMethodName == str(name).split(' ')[0]:
+                local_log.results("Testcase "+str(test_case)+": SKIPPED")
+                passed = False
+        if passed:
+            local_log.results("Testcase "+str(test_case)+": PASSED")
 
     original_class.run = run
     return original_class
-- 
1.9.3



  reply	other threads:[~2014-12-23 16:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-23 16:08 [PATCH 0/7] oe-selftest QA test fixes Paul Eggleton
2014-12-23 16:08 ` Paul Eggleton [this message]
2014-12-23 16:08 ` [PATCH 2/7] oeqa/utils: fix testcase decorator to allow calling tests individually Paul Eggleton
2014-12-23 16:08 ` [PATCH 3/7] oeqa/selftest: fix test_event_handler for changes in bitbake output Paul Eggleton
2014-12-23 16:08 ` [PATCH 4/7] oeqa/selftest: skip test_incremental_image_generation if not using rpm Paul Eggleton
2014-12-23 16:08 ` [PATCH 5/7] oeqa/selftest: improve failure messages for devtool tests Paul Eggleton
2014-12-23 16:08 ` [PATCH 6/7] oeqa/selftest: populate pkgdata/shlibs in test_recipetool_create_git Paul Eggleton
2014-12-23 16:08 ` [PATCH 7/7] oeqa/selftest: fix test_force_task so it doesn't taint the entire build Paul Eggleton
2014-12-23 16:20   ` Paul Eggleton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f707823fb4cdfd1f0ce8f4f70fe1ecb0800ddad4.1419350817.git.paul.eggleton@linux.intel.com \
    --to=paul.eggleton@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox