Ejemplo n.º 1
0
def test_tag_config_update_tag_group(test_cfg: tags.TagConfig) -> None:
    with pytest.raises(MKGeneralException, match="Unknown tag group"):
        test_cfg.update_tag_group(
            tags.TagGroup.from_config({
                "id":
                "tgid2",
                "topic":
                "Topics",
                "title":
                "titlor",
                "tags": [{
                    "id": "tgid2",
                    "title": "tagid2",
                    "aux_tags": []
                }],
            }))
        test_cfg.validate_config()

    test_cfg.update_tag_group(
        tags.TagGroup.from_config({
            "id":
            "networking",
            "title":
            "title",
            "tags": [{
                "id": "tgid2",
                "title": "tagid2",
                "aux_tags": []
            }],
        }))
    assert test_cfg.tag_groups[1].title == "title"
    test_cfg.validate_config()
Ejemplo n.º 2
0
def test_tag_config_update_tag_group(test_cfg: tags.TagConfig) -> None:
    with pytest.raises(MKGeneralException, match="Unknown tag group"):
        test_cfg.update_tag_group(
            tags.TagGroup(("tgid2", "Topics/titlor", [("tgid2", "tagid2", [])]))
        )
        test_cfg.validate_config()

    test_cfg.update_tag_group(tags.TagGroup(("networking", "title", [("tgid2", "tagid2", [])])))
    assert test_cfg.tag_groups[1].title == "title"
    test_cfg.validate_config()