#!/usr/bin/python
import unittest

from fmf_metadata import FMF
from fmf_metadata.base import generic_metadata_setter, FMF_ATTR_PREFIX

@FMF.tag("example", post_mark="+")
@FMF.adjust("distro > Fedora-33")
class Test1(unittest.TestCase):


    @FMF.tag("tier2", post_mark="+")
    def testTagExtensionPost(self):
        pass

    @FMF.summary("This is nondestructive test")
    @FMF.description("it just show first page after login page")
    def testSummaryTag(self):
        pass

    @FMF.adjust("distro ~< centos-6")
    @FMF.adjust("component == cockpit", environment={"shell": True})
    def testAdjust(self):
        pass

    def testSummaryDOCstr(self):
        """
        Basic test of cockpit login abilities

        It show system page after login
        """
        pass

    @FMF.tier("tier1")
    def testDynamicFMFattr(self):
        pass


@FMF.tag("example")
@FMF.link("url://link", {"dependson": "url://link4"})
class TestLinks(unittest.TestCase):

    @FMF.bug("url://link2")
    def testOne(self):
        self.assertTrue(True)

    @FMF.link("url://link3")
    def testThree(self):
        self.assertTrue(True)

@generic_metadata_setter(FMF_ATTR_PREFIX + "adjust", [{"a": "b"}], base_type=dict)
@generic_metadata_setter(FMF_ATTR_PREFIX + "adjust", [{"b": "d"}], base_type=dict)
class TestDictMerge(unittest.TestCase):

    @generic_metadata_setter(FMF_ATTR_PREFIX + "adjust", [{"a": "c"}], base_type=dict)
    @generic_metadata_setter(FMF_ATTR_PREFIX + "adjust", [{"x": "y"}], base_type=dict)
    def test(self):
        self.assertTrue(True)
