#!/usr/bin/env python3
"""Test framework utility functions tests"""

import unittest
from framework import VppTestRunner, CPUInterface
from vpp_papi import mac_pton, mac_ntop


class TestUtil(CPUInterface, unittest.TestCase):
    """Test framework utility tests"""

    @classmethod
    def is_tagged_run_solo(cls):
        """if the test case class is timing-sensitive - return true"""
        return False

    @classmethod
    def has_tag(cls, tag):
        """if the test case has a given tag - return true"""
        try:
            return tag in cls.test_tags
        except AttributeError:
            pass
        return False

    @classmethod
    def get_cpus_required(cls):
        return 0

    def test_mac_to_binary(self):
        """MAC to binary and back"""
        mac = "aa:bb:cc:dd:ee:ff"
        b = mac_pton(mac)
        mac2 = mac_ntop(b)
        self.assertEqual(type(mac), type(mac2))
        self.assertEqual(mac2, mac)


if __name__ == "__main__":
    unittest.main(testRunner=VppTestRunner)
