def METHOD_NAME(context):
    '''
    Disconnecting the `localhost` source should not break the DB
    '''
    require_user('root')
    nsname = context.new_nsname
    localhost_ifnum = 0
    nsname_ifnum = 0
    total_ifnum = 0
    #
    # attach the NetNS source
    context.ndb.sources.add(netns=nsname)
    #
    # lock the DB
    total_ifnum = context.ndb.interfaces.dump().count()
    with context.ndb.interfaces.dump() as dump:
        dump.select_records(target='localhost')
        localhost_ifnum = len(tuple(dump))
    with context.ndb.interfaces.dump() as dump:
        dump.select_records(target=nsname)
        nsname_ifnum = len(tuple(dump))
    assert localhost_ifnum == count_interfaces(context.ndb, 'localhost')
    assert nsname_ifnum == count_interfaces(context.ndb, nsname)
    assert 0 < count_interfaces(context.ndb, 'localhost') < total_ifnum
    assert 0 < count_interfaces(context.ndb, nsname) < total_ifnum
    context.ndb.sources.remove('localhost')
    #
    # the number of 'localhost' interfaces must be 0 here
    with context.ndb.interfaces.dump() as dump:
        dump.select_records(target='localhost')
        assert len(list(dump)) == 0
        assert count_interfaces(context.ndb, 'localhost') == 0
    #
    # the number of `nsname` interfaces must remain the same as before
    with context.ndb.interfaces.dump() as dump:
        dump.select_records(target=nsname)
        s = len(list(dump))
        assert s > 0
        assert count_interfaces(context.ndb, nsname) == s