Example #1
0
    def test(handle_ui_info):
        path = tempfile.mkdtemp()

        config = p.join(path, "config.json")
        source = p.join(path, "source.vhd")

        # Make sure the files exists
        open(config, "w").write("")
        open(source, "w").write("")

        project = DummyServer(_Path(path))
        project.setConfig(Path(config))
        # Get messages of anything to trigger reading the config
        project.getMessagesByPath(Path(source))

        handle_ui_info.assert_called_once_with("No sources were added")

        removeIfExists(path)
    def test(handle_ui_info):

        path = tempfile.mkdtemp()

        config = p.join(path, "config.json")
        source = p.join(path, "source.vhd")

        # Make sure the files exist
        open(config, "w").write("")
        open(source, "w").write("")

        project = DummyServer(_Path(path))
        project.setConfig(_Path(config), origin=ConfigFileOrigin.generated)
        # Get messages of anything to trigger reading the config
        project.getMessagesByPath(Path(source))

        handle_ui_info.assert_called_once_with(
            hdl_checker.base_server._HOW_LONG_IS_TOO_LONG_MSG)

        removeIfExists(path)