# Path: app/sync.py
# EC = EnjoliverConfig(importer=__file__)
# class ConfigSyncSchedules(object):
#     def __init__(self, api_uri: str, matchbox_path: str, ignition_dict: dict, extra_selector_dict=None):
#     def _reporting_ignitions(self):
#     def get_dns_attr(fqdn: str):
#     def cni_ipam(host_cidrv4: str, host_gateway: str):
#     def get_first_ip_address(ip_range: str):
#     def get_extra_selectors(extra_selectors: dict):
#     def etcd_member_ip_list(self):
#     def kubernetes_control_plane_ip_list(self):
#     def kubernetes_nodes_ip_list(self):
#     def order_http_uri(ips: list, ec_value: int, secure=False):
#     def order_etcd_named(ips: list, ec_value: int, secure=False):
#     def kubernetes_etcd_initial_cluster(self):
#     def vault_etcd_initial_cluster(self):
#     def fleet_etcd_initial_cluster(self):
#     def kubernetes_etcd_member_client_uri_list(self):
#     def vault_etcd_member_client_uri_list(self):
#     def fleet_etcd_member_client_uri_list(self):
#     def kubernetes_etcd_member_peer_uri_list(self):
#     def vault_etcd_member_peer_uri_list(self):
#     def fleet_etcd_member_peer_uri_list(self):
#     def kubernetes_control_plane(self):
#     def compute_disks_size(disks: list):
#     def produce_matchbox_data(self, marker: str, i: int, m: dict, automatic_name: str, update_extra_metadata=None):
#     def etcd_member_kubernetes_control_plane(self):
#     def kubernetes_nodes(self):
#     def notify(self):
#     def apply(self, nb_try=2, seconds_sleep=0):
#     def _query_roles(self, *roles):
#     def _query_ip_list(self, role):


import json
import os
from unittest import TestCase
from app import sync

    def test_06(self):
        sync.EC.disks_ladder_gb = {"S": 10, "M": 20, "L": 30}
        r = sync.ConfigSyncSchedules.compute_disks_size([
            {
                "path": "/dev/sda",
                "size-bytes": 10737418240
            },
            {
                "path": "/dev/sdb",
                "size-bytes": 21474836480
            },
        ])
        self.assertEqual("L", r)
        r = sync.ConfigSyncSchedules.compute_disks_size([
            {
                "path": "/dev/sda",
                "size-bytes": 10737418240
            },
        ])
        self.assertEqual("M", r)
        r = sync.ConfigSyncSchedules.compute_disks_size([
            {
                "path": "/dev/sda",
                "size-bytes": 9737418240
            },
        ])
        self.assertEqual("S", r)

    def test_07(self):

# Path: app/sync.py
# EC = EnjoliverConfig(importer=__file__)
# class ConfigSyncSchedules(object):
#     def __init__(self, api_uri: str, matchbox_path: str, ignition_dict: dict, extra_selector_dict=None):
#     def _reporting_ignitions(self):
#     def get_dns_attr(fqdn: str):
#     def cni_ipam(host_cidrv4: str, host_gateway: str):
#     def get_first_ip_address(ip_range: str):
#     def get_extra_selectors(extra_selectors: dict):
#     def etcd_member_ip_list(self):
#     def kubernetes_control_plane_ip_list(self):
#     def kubernetes_nodes_ip_list(self):
#     def order_http_uri(ips: list, ec_value: int, secure=False):
#     def order_etcd_named(ips: list, ec_value: int, secure=False):
#     def kubernetes_etcd_initial_cluster(self):
#     def vault_etcd_initial_cluster(self):
#     def fleet_etcd_initial_cluster(self):
#     def kubernetes_etcd_member_client_uri_list(self):
#     def vault_etcd_member_client_uri_list(self):
#     def fleet_etcd_member_client_uri_list(self):
#     def kubernetes_etcd_member_peer_uri_list(self):
#     def vault_etcd_member_peer_uri_list(self):
#     def fleet_etcd_member_peer_uri_list(self):
#     def kubernetes_control_plane(self):
#     def compute_disks_size(disks: list):
#     def produce_matchbox_data(self, marker: str, i: int, m: dict, automatic_name: str, update_extra_metadata=None):
#     def etcd_member_kubernetes_control_plane(self):
#     def kubernetes_nodes(self):
#     def notify(self):
#     def apply(self, nb_try=2, seconds_sleep=0):
#     def _query_roles(self, *roles):
#     def _query_ip_list(self, role):


# Path: app/tests/unit/test_sync.py
import json
import os
from unittest import TestCase
from app import sync


    def test_06(self):
        sync.EC.disks_ladder_gb = {"S": 10, "M": 20, "L": 30}
        r = sync.ConfigSyncSchedules.compute_disks_size([
            {
                "path": "/dev/sda",
                "size-bytes": 10737418240
            },
            {
                "path": "/dev/sdb",
                "size-bytes": 21474836480
            },
        ])
        self.assertEqual("L", r)
        r = sync.ConfigSyncSchedules.compute_disks_size([
            {
                "path": "/dev/sda",
                "size-bytes": 10737418240
            },
        ])
        self.assertEqual("M", r)
        r = sync.ConfigSyncSchedules.compute_disks_size([
            {
                "path": "/dev/sda",
                "size-bytes": 9737418240
            },
        ])
        self.assertEqual("S", r)

    def test_07(self):

        ip_address = sync.ConfigSyncSchedules.get_first_ip_address("172.30.0.0/24")