Skip to content

Commit

Permalink
More clean up, focusing on unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdln committed Dec 21, 2009
1 parent 05bde7d commit 5c692b2
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
2 changes: 2 additions & 0 deletions flashbake/__init__.py
Expand Up @@ -26,6 +26,8 @@
import os
import os.path
import re
import sys #@Reimport




Expand Down
2 changes: 0 additions & 2 deletions flashbake/plugins/__init__.py
Expand Up @@ -90,12 +90,10 @@ def init(self, config):
""" This method is optional. """
pass


def dependencies(self):
""" Optional method via which a plugin can express a dependency on another plugin. """
return list()


def __capture_property(self, config, name, type=None, required=False, default=None):
""" Move a property, if present, from the ControlConfig to the daughter
plugin. """
Expand Down
7 changes: 3 additions & 4 deletions test/config.py
@@ -1,6 +1,5 @@
from flashbake import ControlConfig
from flashbake.plugins import PluginError
import logging
import unittest


Expand All @@ -10,15 +9,15 @@ def setUp(self):

def testinvalidspec(self):
try:
plugin = self.config.create_plugin('test.foo')
self.config.create_plugin('test.foo')
self.fail('Should not be able to use unknown')
except PluginError, error:
self.assertEquals(str(error.reason), 'invalid_plugin',
'Should not be able to load invalid plugin.')

def testnoplugin(self):
try:
plugin = self.config.create_plugin('test.foo:Foo')
self.config.create_plugin('test.foo:Foo')
self.fail('Should not be able to use unknown')
except PluginError, error:
self.assertEquals(str(error.reason), 'unknown_plugin',
Expand All @@ -27,7 +26,7 @@ def testnoplugin(self):
def testmissingparent(self):
try:
plugin_name = 'test.plugins:MissingParent'
plugin = self.config.create_plugin(plugin_name)
self.config.create_plugin(plugin_name)
self.fail('Should not have initialized plugin, %s' % plugin_name)
except PluginError, error:
reason = 'invalid_type'
Expand Down
2 changes: 0 additions & 2 deletions test/files.py
@@ -1,7 +1,5 @@
import commands
import flashbake
import logging
import os
import os.path
import unittest

Expand Down
3 changes: 1 addition & 2 deletions test/test.py
Expand Up @@ -20,8 +20,7 @@
# along with flashbake. If not, see <http://www.gnu.org/licenses/>.

import sys
import os
from os.path import join, dirname, exists, realpath, abspath
from os.path import join, realpath, abspath
import unittest
import logging

Expand Down

0 comments on commit 5c692b2

Please sign in to comment.