#
# Copyright (C) 2016 FreeIPA Contributors see COPYING for license
#
"""
Test the `ipaserver/dnssec` package.
"""
import dns.name
from ipaserver.dnssec.odsmgr import ODSZoneListReader
ZONELIST_XML = """
default
/var/lib/ipa/dns/zone/entryUUID/12345
"""
def test_ods_zonelist_reader():
uuid = '12345'
name = dns.name.from_text('ipa.example.')
reader = ODSZoneListReader("")
assert reader.mapping == {}
assert reader.names == set()
assert reader.uuids == set()
reader = ODSZoneListReader(ZONELIST_XML)
assert reader.mapping == {uuid: name}
assert reader.names == {name}
assert reader.uuids == {uuid}