semvec/pypi-packages huggingface dataset:
app-page-core 0.0.7
python page application framework
License: MIT

# Python app framework

# Installation
```shell
pip install app-page-core
```
# Page页面属性
callback   回调管理对象
children   子页面管理对象
store      全局变量管理对象

# Usage
应用首页，初始化全局对象，页面对象，加载页面
app.py
```python
from app_page import Store, Page

def signal_slots_func(signal, id, func):
  # 绑定信号与槽函数
  print(signal, id, func)

# 初始化全局对象
Store({
  "version": "1.0.0",
  "isLogin": False,
  "functions": {
    # 信号与槽绑定函数"__signal_slots_func"
    "__signal_slots_func": signal_slots_func,
  },
})

# 初始化页面对象
page = Page()
page.setup('app.json')
```
配置页面结构
app.json
```json
{
  "name": "main",
  "id": "id001",
  "style": "app.css",
  "children": "children/page.json",
  "events": {
    "clicked": {
      "btn1": "sendMessage",
      "btn2": "cancel"
    }
  },
  "functions": {
    "sendMessage": "functions/sendMessage.py",
    "cancel": "functions/cancel.py"
  }
}
```
pytest-yls 1.4.4
Pytest plugin to test the YLS as a whole.
License: MIT
Requires Python: <4.0,>=3.8

# pytest-yls

![PyPI](https://img.shields.io/pypi/v/pytest-yls)

Pytest plugin adding primitives for E2E/integration tests.

Public fixtures:
- `yls_prepare`
- `yls_prepare_with_settings`

To interact with the tested YLS use `Context` obtained by calling the fixture.
For more information about the `Context` class checkout
[plugin.py](https://github.com/avast/yls/blob/master/pytest-yls/pytest_yls/plugin.py).

### Example test

```python

# Add yls_prepare fixture
def test_completion_basic(yls_prepare):
    # Prepare the tested file
    # <$> marks the cursor position
    contents = """rule test {
    condition:
        <$>
}"""
    
    # Initialize the testing context by calling the fixture
    context = yls_prepare(contents)

    # You can now simulate requests on the context
    # In this case we trigger the code completion
    response = context.send_request(
        methods.COMPLETION,
        types.CompletionParams(
            textDocument=types.TextDocumentIdentifier(uri=context.opened_file.as_uri()),
            position=context.get_cursor_position(),
        ),
    )

    # Assert the response how you want
    assert response
    for module in ["cuckoo", "elf", "pe", "time"]:
        assert any(
            module in item["label"] for item in response["items"]
        ), f"{module=} is not in response"
```

For more inspiration check out
[yls/tests](https://github.com/avast/yls/tree/master/tests).

## License

Copyright (c) 2022 Avast Software, licensed under the MIT license. See the
[`LICENSE`](https://github.com/avast/yls/blob/master/pytest-yls/LICENSE) file
for more details.