Exemplo n.º 1
0
def test_new_campaign_reload(ns_3_compiled, config, manager, result):
    # Insert a result in the already available CampaignManager
    manager.db.insert_result(result)

    # Try creating a new CampaignManager with the same settings
    new_campaign = CampaignManager.new(ns_3_compiled, config['script'],
                                       config['campaign_dir'], overwrite=False)

    # Result should still be there
    assert new_campaign.db.get_results()[0] == result
Exemplo n.º 2
0
def test_new_campaign_reload_overwrite(ns_3_compiled, config, manager, result):
    # Insert a result in the already available CampaignManager
    manager.db.insert_result(result)

    # Try creating a new CampaignManager with the same settings
    new_campaign = CampaignManager.new(ns_3_compiled, config['script'],
                                       config['campaign_dir'], overwrite=True)

    # There should be no results
    assert len(new_campaign.db.get_results()) == 0
Exemplo n.º 3
0
def manager(ns_3_compiled, config):
    return CampaignManager.new(ns_3_compiled, config['script'],
                               config['campaign_dir'])
Exemplo n.º 4
0
def test_load_campaign(manager, config):
    # Try loading the campaign that was created as fixture
    loaded_manager = CampaignManager.load(config['campaign_dir'])
    del config['campaign_dir']
    assert loaded_manager.db.get_config() == config
Exemplo n.º 5
0
def test_campaign_creation(ns_3_compiled, config):
    CampaignManager.new(ns_3_compiled, config['script'],
                        config['campaign_dir'])