def METHOD_NAME(context):
    ifname = context.new_ifname
    ipaddr1 = context.new_ipaddr
    ipaddr2 = context.new_ipaddr
    with context.ndb.interfaces.create(
        ifname=ifname, kind='dummy', state='up'
    ) as interface:
        interface.add_ip(address=ipaddr1, prefixlen=24)
        interface.add_ip(address=ipaddr2, prefixlen=24)
    with context.ndb.interfaces[ifname].ipaddr.dump() as dump:
        dump.select_records(lambda x: x.family == AF_INET)
        assert len(repr(dump).split('\n')) == 2