Lines Matching +full:class +full:- +full:utils
7 # http://www.apache.org/licenses/LICENSE-2.0
14 """Tests the functionality of the utils module's functions"""
21 import utils
27 'cifuzz', 'test_data', 'build-out')
30 class IsFuzzTargetLocalTest(unittest.TestCase):
35 is_local = utils.is_fuzz_target_local('not/a/real/file')
37 is_local = utils.is_fuzz_target_local('')
39 is_local = utils.is_fuzz_target_local(' ')
45 is_local = utils.is_fuzz_target_local(
48 is_local = utils.is_fuzz_target_local(TEST_OUT_DIR)
52 class GetFuzzTargetsTest(unittest.TestCase):
57 fuzz_targets = utils.get_fuzz_targets(TEST_OUT_DIR)
64 fuzz_targets = utils.get_fuzz_targets(
70 fuzz_targets = utils.get_fuzz_targets('not/a/valid/file/path')
74 class ExecuteTest(unittest.TestCase):
80 out, err, err_code = utils.execute(['ls', '.'],
86 out, err, err_code = utils.execute(['mkdir', 'tmp'],
92 out, err, err_code = utils.execute(['ls', '.'],
102 out, err, err_code = utils.execute(['ls', 'notarealdir'],
109 out, err, err_code = utils.execute(['ls', 'notarealdir'],
114 class BinaryPrintTest(unittest.TestCase):
115 """Tests for utils.binary_print."""
117 @unittest.skip('Causes spurious failures because of side-effects.')
118 def test_string(self): # pylint: disable=no-self-use
119 """Tests that utils.binary_print can print a regular string."""
122 utils.binary_print('hello')
125 @unittest.skip('Causes spurious failures because of side-effects.')
126 def test_binary_string(self): # pylint: disable=no-self-use
127 """Tests that utils.binary_print can print a bianry string."""
130 utils.binary_print(b'hello')
134 class CommandToStringTest(unittest.TestCase):
141 self.assertEqual(utils.command_to_string(command), command)
147 self.assertEqual(utils.command_to_string(command), 'command arg1 arg2')