mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-05 12:16:41 +02:00
Fix doc string and use self.assertRaises
This commit is contained in:
parent
fba0975883
commit
8fcab50063
@ -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.
|
||||
|
||||
@ -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):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user