Esempio n. 1
0
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()
Esempio n. 2
0
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()
Esempio n. 3
0
def test_process_new_machine():
    investigator = Investigator()
    investigator.logger = module_logger
    ip = '0.0.0.0'
    investigator.process_new_machine(ip)
Esempio n. 4
0
def test_get_algos():
    investigator = Investigator()
    investigator.logger = module_logger
    investigator.register_algorithm('cubed', lambda x: x**3)
    assert 'cubed' in investigator.get_algorithms()
Esempio n. 5
0
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()
Esempio n. 6
0
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()
Esempio n. 7
0
def test_register_algo():
    investigator = Investigator()
    investigator.logger = module_logger
    investigator.register_algorithm('cubed', lambda x: x**3)
Esempio n. 8
0
def test_update_rules():
    investigator = Investigator()
    investigator.logger = module_logger
    investigator.update_rules()
Esempio n. 9
0
def test_update_config():
    investigator = Investigator()
    investigator.logger = module_logger
    investigator.update_config()
Esempio n. 10
0
def test_Investigator():
    Investigator()