Exemple #1
0
def test_open_proj_new_window():
    with pytest_hackedit.MainWindow(PATH1, remove_project_folder=True) as w:
        settings.set_open_mode(settings.OpenMode.NEW_WINDOW)
        assert len(project.get_projects()) == 1
        project.open_project(PATH2, sender=w)
        assert len(w.instance.app.editor_windows) == 2
        assert len(project.get_projects()) == 1
        pytest_hackedit.app().editor_windows[-1].close()
def test_get_configurations_by_mtype():
    pytest_hackedit.app()
    plugin = plugins.get_compiler_plugin_by_typename('GnuCOBOL')
    config = plugin.create_new_configuration('name', 'cobc')
    settings.save_compiler_configurations({'test': config})
    mtype_cfg = compiler.get_configs_for_mimetype(config.mimetypes[0])[0]
    mtype_cfg.name = config.name
    assert mtype_cfg.to_json() == config.to_json()
Exemple #3
0
def test_get_configs_for_mimetype():
    pytest_hackedit.app()
    plugin = plugins.get_pre_compiler_plugin_by_typename('SQL COBOL - dbpre')
    config = plugin.create_new_configuration('name',
                                             'path',
                                             extra_options=('obj', 'copyboks'))
    settings.save_pre_compiler_configurations({'test': config})
    mtype_cfgs = pre_compiler.get_configs_for_mimetype(config.mimetypes[0])
    assert mtype_cfgs[0].to_json() == config.to_json()
Exemple #4
0
def test_correct_type():
    pytest_hackedit.app()
    w = CorrectType().get_window()
    assert w is not None
    assert isinstance(w, MainWindow)
    w.close()
Exemple #5
0
def test_wrong_type():
    pytest_hackedit.app()
    w = WrongType().get_window()
    assert w is None
Exemple #6
0
def test_none_window():
    pytest_hackedit.app()
    w = NoneWindow().get_window()
    assert w is None
Exemple #7
0
def test_no_window(qtbot):
    pytest_hackedit.app()
    assert NoWindow().get_window() is None
Exemple #8
0
 def __init__(self):
     self.main_window = MainWindow(pytest_hackedit.app(), PROJ_PATH,
                                   GenericWorkspace.get_data())
Exemple #9
0
def test_correct_type():
    pytest_hackedit.app()
    w = CorrectType().get_window()
    assert w is not None
    assert isinstance(w, MainWindow)
    w.close()
Exemple #10
0
def test_wrong_type():
    pytest_hackedit.app()
    w = WrongType().get_window()
    assert w is None
Exemple #11
0
def test_none_window():
    pytest_hackedit.app()
    w = NoneWindow().get_window()
    assert w is None
Exemple #12
0
def test_no_window(qtbot):
    pytest_hackedit.app()
    assert NoWindow().get_window() is None
Exemple #13
0
 def __init__(self):
     self.main_window = MainWindow(pytest_hackedit.app(), PROJ_PATH,
                                   GenericWorkspace.get_data())