Fix doc string and use self.assertRaises

This commit is contained in:
Scott Zawalski 2010-10-05 10:39:51 -07:00
parent fba0975883
commit 8fcab50063
2 changed files with 5 additions and 8 deletions

View File

@ -120,10 +120,11 @@ def GetVersion():
def LoadPrivateFilters(build_path):
"""Load a file with keywords on a per line basis.
"""Load private filters based on ebuilds found under _PRIVATE_OVERLAY_DIR.
This function adds filters to the global set _FILTER_PACKAGES.
Args:
filter_file: file to load into _FILTER_PACKAGES
build_path: Path that _PRIVATE_OVERLAY_DIR is in.
"""
# TODO(scottz): eventually use manifest.xml to find the proper
# private overlay path.

View File

@ -122,12 +122,8 @@ class TestPrebuiltFilters(unittest.TestCase):
def testEmptyFiltersErrors(self):
"""Ensure LoadPrivateFilters errors if an empty list is generated."""
os.makedirs(os.path.join(self.tmp_dir, prebuilt._PRIVATE_OVERLAY_DIR))
try:
prebuilt.LoadPrivateFilters(self.tmp_dir)
except prebuilt.FiltersEmpty:
return
self.fail('Exception was not raised for empty list')
self.assertRaises(prebuilt.FiltersEmpty, prebuilt.LoadPrivateFilters,
self.tmp_dir)
class TestPrebuilt(unittest.TestCase):