def setUp(self): # FIXME: Add support for Windows. if not environment.is_posix(): self.skipTest( 'Process tests are only applicable for posix platforms.') test_utils.set_up_pyfakefs(self)
def setUp(self): """Setup for recommended dictionary test.""" # FIXME: Add support for Windows. if not environment.is_posix(): self.skipTest( 'Process tests are only applicable for posix platforms.') self.data_directory = os.path.join(os.path.dirname(__file__), 'data') dictionaries_directory = os.path.join(self.data_directory, 'dictionaries') self.dictionary_from_repository_data = read_data_from_file( os.path.join(dictionaries_directory, 'dictionary_from_repository.dict')) self.expected_merged_dictionary_data = read_data_from_file( os.path.join(dictionaries_directory, 'expected_merged_dictionary.dict')) self.expected_gcs_only_merged_dictionary_data = read_data_from_file( os.path.join(dictionaries_directory, 'expected_gcs_only_merged_dictionary.dict')) self.fake_gcs_dictionary_data = read_data_from_file( os.path.join(dictionaries_directory, 'fake_gcs_dictionary.dict')) test_helpers.patch(self, [ 'bot.fuzzers.dictionary_manager.DictionaryManager.' 'download_recommended_dictionary_from_gcs', 'os.getpid', ]) self.mock.download_recommended_dictionary_from_gcs.side_effect = ( self.mock_download_recommended_dictionary_from_gcs) self.mock.getpid.return_value = 1337 test_utils.set_up_pyfakefs(self) self.work_directory_path = '/fake/fuzzers/' self.fuzz_inputs_path = '/fake/fuzzers/inputs' self.fuzz_inputs_disk_path = '/fake/fuzzers/inputs-disk' self.fs.create_dir(self.work_directory_path) self.fs.create_dir(self.fuzz_inputs_path) self.fs.create_dir(self.fuzz_inputs_disk_path) self.local_dictionaries_dir = os.path.join(self.work_directory_path, 'dicts') self.fs.create_dir(self.local_dictionaries_dir) self.fuzzer_name = 'test_fuzzer' self.fuzzer_path = os.path.join(self.work_directory_path, self.fuzzer_name) test_helpers.patch_environ(self) environment.set_value('FAIL_RETRIES', '1') environment.set_value('FUZZ_INPUTS', self.fuzz_inputs_path) environment.set_value('FUZZ_INPUTS_DISK', self.fuzz_inputs_disk_path)
def setUp(self): # FIXME: Add support for Windows. if not environment.is_posix(): self.skipTest('Which test is only supported on posix platforms.')