<commit_before>from . import integration


def test_kcm_describe():
    args = ["describe", "--conf-dir={}".format(integration.conf_dir("ok"))]
    assert integration.execute(integration.kcm(), args) == b"""{
  "path": "/kcm/tests/data/config/ok",
  "pools": {
    "controlplane": {
      "cpuLists": {
        "3,11": {
          "cpus": "3,11",
          "tasks": [
            1000,
            1001,
            1002,
            1003
          ]
        }
      },
      "exclusive": false,
      "name": "controlplane"
    },
    "dataplane": {
      "cpuLists": {
        "4,12": {
          "cpus": "4,12",
          "tasks": [
            2000
          ]
        },
        "5,13": {
          "cpus": "5,13",
          "tasks": [
            2001
          ]
        },
        "6,14": {
          "cpus": "6,14",
          "tasks": [
            2002
          ]
        },
        "7,15": {
          "cpus": "7,15",
          "tasks": [
            2003
          ]
        }
      },
      "exclusive": true,
      "name": "dataplane"
    },
    "infra": {
      "cpuLists": {
        "0-2,8-10": {
          "cpus": "0-2,8-10",
          "tasks": [
            3000,
            3001,
            3002
          ]
        }
      },
      "exclusive": false,
      "name": "infra"
    }
  }
}
"""<commit_msg>Added test case for kcm describe.<commit_after>from . import integration


def test_kcm_describe_ok():
    args = ["describe", "--conf-dir={}".format(integration.conf_dir("ok"))]
    assert integration.execute(integration.kcm(), args) == b"""{
  "path": "/kcm/tests/data/config/ok",
  "pools": {
    "controlplane": {
      "cpuLists": {
        "3,11": {
          "cpus": "3,11",
          "tasks": [
            1000,
            1001,
            1002,
            1003
          ]
        }
      },
      "exclusive": false,
      "name": "controlplane"
    },
    "dataplane": {
      "cpuLists": {
        "4,12": {
          "cpus": "4,12",
          "tasks": [
            2000
          ]
        },
        "5,13": {
          "cpus": "5,13",
          "tasks": [
            2001
          ]
        },
        "6,14": {
          "cpus": "6,14",
          "tasks": [
            2002
          ]
        },
        "7,15": {
          "cpus": "7,15",
          "tasks": [
            2003
          ]
        }
      },
      "exclusive": true,
      "name": "dataplane"
    },
    "infra": {
      "cpuLists": {
        "0-2,8-10": {
          "cpus": "0-2,8-10",
          "tasks": [
            3000,
            3001,
            3002
          ]
        }
      },
      "exclusive": false,
      "name": "infra"
    }
  }
}
"""


def test_kcm_describe_minimal():
    args = ["describe",
            "--conf-dir={}".format(integration.conf_dir("minimal"))]
    assert integration.execute(integration.kcm(), args) == b"""{
  "path": "/kcm/tests/data/config/minimal",
  "pools": {
    "exclusive": {
      "cpuLists": {
        "0": {
          "cpus": "0",
          "tasks": []
        }
      },
      "exclusive": true,
      "name": "exclusive"
    },
    "shared": {
      "cpuLists": {
        "0": {
          "cpus": "0",
          "tasks": []
        }
      },
      "exclusive": false,
      "name": "shared"
    }
  }
}
"""
{'fraction_non_alphanumeric': 0.18919743667989014, 'fraction_numerical': 0.05248703082087275, 'mean_word_length': 1.143884892086331, 'pattern_counts': {'":': 80, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3090958', 'n_tokens_mistral': 1215, 'n_tokens_neox': 1096, 'n_words': 173}