# Path: librouteros/query.py
# class Key:
# 
#     def __init__(self, name: str):
#         self.name = name
# 
#     def __eq__(self, other):
#         yield f'?={self}={cast_to_api(other)}'
# 
#     def __ne__(self, other):
#         yield from self == other
#         yield '?#!'
# 
#     def __lt__(self, other):
#         yield f'?<{self}={cast_to_api(other)}'
# 
#     def __gt__(self, other):
#         yield f'?>{self}={cast_to_api(other)}'
# 
#     def __str__(self) -> str:
#         return str(self.name)
# 
#     # pylint: disable=invalid-name
#     def In(self, one, *elems):
#         yield from self == one
#         yield from chain.from_iterable(self == str(elem) for elem in elems)
#         yield from ('?#|', ) * len(elems)


from librouteros.query import Key


def test_add_then_remove(routeros_api):
    ips = routeros_api.path('ip', 'address')
    new_id = ips.add(interface='ether1', address='192.168.1.1/24')
    ips.remove(new_id)

# Path: librouteros/query.py
# class Key:
# 
#     def __init__(self, name: str):
#         self.name = name
# 
#     def __eq__(self, other):
#         yield f'?={self}={cast_to_api(other)}'
# 
#     def __ne__(self, other):
#         yield from self == other
#         yield '?#!'
# 
#     def __lt__(self, other):
#         yield f'?<{self}={cast_to_api(other)}'
# 
#     def __gt__(self, other):
#         yield f'?>{self}={cast_to_api(other)}'
# 
#     def __str__(self) -> str:
#         return str(self.name)
# 
#     # pylint: disable=invalid-name
#     def In(self, one, *elems):
#         yield from self == one
#         yield from chain.from_iterable(self == str(elem) for elem in elems)
#         yield from ('?#|', ) * len(elems)


# Path: tests/integration/test_path.py
from librouteros.query import Key



def test_add_then_remove(routeros_api):
    ips = routeros_api.path('ip', 'address')
    new_id = ips.add(interface='ether1', address='192.168.1.1/24')
    ips.remove(new_id)

    _id = Key('.id')