def test_profile_clone(false_plugin_with_holder): """Test cloning a profile. """ p = ProfileInfos(path=PROFILE_PATH, plugin=false_plugin_with_holder) p.id = 'new' p2 = p.clone() assert p2.id == 'new' assert p2.model.model == 'model'
def test_profile_write(tmpdir, false_plugin_with_holder): """Test writing a modified profile. """ p = ProfileInfos(path=PROFILE_PATH, plugin=false_plugin_with_holder) p.id = 'new' p.model.serie = 'S' p.model.model = 'm2' p.connections['new'] = {'inf': 1} p.settings['new'] = {'inf': 2} path = str(tmpdir.join('new.ini')) p.path = path p.write_to_file() p = ProfileInfos(path=path, plugin=false_plugin_with_holder) assert p.id == 'new' assert p.model.model == 'm2' assert 'new' in p.connections and 'visa_tcpip' in p.connections assert 'new' in p.settings and 'lantz' in p.settings