def test_clear(): investigator = Investigator() investigator.logger = module_logger investigator.register_algorithm('cubed', lambda x: x**3) investigator.register_algorithm('squared', lambda x: x**2) investigator.clear() assert 0 == investigator.count_algorithms()
def test_config_vctrl_machines(): investigator = Investigator() investigator.config_dict[ 'vent_machine_test'] = 'name=triton provider=amphitrite cpus=500' assert 'triton' not in investigator.vent_machines investigator.vent_machines['trident1'] = '0.0.0.0' investigator.vctrl_startup()
def test_process_new_machine(): investigator = Investigator() investigator.logger = module_logger ip = '0.0.0.0' investigator.process_new_machine(ip)
def test_get_algos(): investigator = Investigator() investigator.logger = module_logger investigator.register_algorithm('cubed', lambda x: x**3) assert 'cubed' in investigator.get_algorithms()
def test_count_algos(): investigator = Investigator() investigator.logger = module_logger investigator.register_algorithm('cubed', lambda x: x**3) investigator.register_algorithm('cubed', lambda x: x**3) assert 1 == investigator.count_algorithms()
def test_delete_algo(): investigator = Investigator() investigator.logger = module_logger investigator.register_algorithm('cubed', lambda x: x**3) investigator.register_algorithm('squared', lambda x: x**2) assert 2 == investigator.count_algorithms() investigator.delete_algorithm('squared') investigator.delete_algorithm('squared') assert 1 == investigator.count_algorithms() investigator.delete_algorithm('cubed') assert 0 == investigator.count_algorithms()
def test_register_algo(): investigator = Investigator() investigator.logger = module_logger investigator.register_algorithm('cubed', lambda x: x**3)
def test_update_rules(): investigator = Investigator() investigator.logger = module_logger investigator.update_rules()
def test_update_config(): investigator = Investigator() investigator.logger = module_logger investigator.update_config()
def test_Investigator(): Investigator()