# Path: netman/core/objects/port_modes.py
# BOND_MEMBER = "BOND_MEMBER"


from hamcrest import is_, assert_that, empty, none
from netman.core.objects.exceptions import UnknownInterface
from netman.core.objects.port_modes import BOND_MEMBER
from tests.adapters.compliance_test_case import ComplianceTestCase

    def test_resets_the_interface_trunk_vlans(self):
        self.client.add_vlan(90)
        self.client.set_trunk_mode(self.test_port)
        self.client.add_trunk_vlan(self.test_port, 90)

        self.client.add_interface_to_bond(self.test_port, 42)
        interface = self.client.get_interface(self.test_port)

        assert_that(interface.trunk_vlans, is_(empty()))
        self.janitor.remove_vlan(90)
        self.janitor.remove_interface_from_bond(self.test_port)
        self.janitor.set_access_mode(self.test_port)

    def test_resets_the_interface_trunk_native_vlan(self):
        self.client.add_vlan(90)
        self.client.set_trunk_mode(self.test_port)
        self.client.set_interface_native_vlan(self.test_port, 90)

        self.client.add_interface_to_bond(self.test_port, 42)
        interface = self.client.get_interface(self.test_port)

        assert_that(interface.trunk_native_vlan, is_(none()))
        self.janitor.remove_vlan(90)
        self.janitor.remove_interface_from_bond(self.test_port)
        self.janitor.set_access_mode(self.test_port)

    def test_resets_the_interface_access_vlan(self):
        self.client.add_vlan(90)
        self.client.set_access_mode(self.test_port)

# Path: netman/core/objects/port_modes.py
# BOND_MEMBER = "BOND_MEMBER"


# Path: tests/adapters/compliance_tests/add_interface_to_bond_test.py
from hamcrest import is_, assert_that, empty, none
from netman.core.objects.exceptions import UnknownInterface
from netman.core.objects.port_modes import BOND_MEMBER
from tests.adapters.compliance_test_case import ComplianceTestCase


    def test_resets_the_interface_trunk_vlans(self):
        self.client.add_vlan(90)
        self.client.set_trunk_mode(self.test_port)
        self.client.add_trunk_vlan(self.test_port, 90)

        self.client.add_interface_to_bond(self.test_port, 42)
        interface = self.client.get_interface(self.test_port)

        assert_that(interface.trunk_vlans, is_(empty()))
        self.janitor.remove_vlan(90)
        self.janitor.remove_interface_from_bond(self.test_port)
        self.janitor.set_access_mode(self.test_port)

    def test_resets_the_interface_trunk_native_vlan(self):
        self.client.add_vlan(90)
        self.client.set_trunk_mode(self.test_port)
        self.client.set_interface_native_vlan(self.test_port, 90)

        self.client.add_interface_to_bond(self.test_port, 42)
        interface = self.client.get_interface(self.test_port)

        assert_that(interface.trunk_native_vlan, is_(none()))
        self.janitor.remove_vlan(90)
        self.janitor.remove_interface_from_bond(self.test_port)
        self.janitor.set_access_mode(self.test_port)

    def test_resets_the_interface_access_vlan(self):
        self.client.add_vlan(90)
        self.client.set_access_mode(self.test_port)

        self.client.set_access_vlan(self.test_port, 90)