#!/usr/bin/python3
# -*- coding: utf-8 -*-
# pylint: disable=C0103

"""
Populate testapi with testscases.
"""

import xtesting_db_populate.config
import xtesting_db_populate.api

# Populate pods
testapi_uri = xtesting_db_populate.config.get_testapi_url()
pods = xtesting_db_populate.config.get_pods_list()
for pod in pods:
    xtesting_db_populate.api.populate_pod(pod, testapi_uri)

# Populate testcases
tests = xtesting_db_populate.config.get_testcases()
for project in tests:
    xtesting_db_populate.api.populate_project(project, testapi_uri)
    for case in tests[project]:
        xtesting_db_populate.api.populate_case(project, case, testapi_uri)
