'Ensure we can extract users from a netgroup file.'

def testNetgroupBufferParser(self):

    parser = linux_file_parser.NetgroupBufferParser()
    buf1 = rdf_client.BufferReference(data='group1    (-,user1,)    (-,user2,)    (-,user3,)\n')
    buf2 = rdf_client.BufferReference(data='super_group3    (-,user5,)    (-,user6,)    group1    group2\n')
    ff_result = rdf_file_finder.FileFinderResult(matches=[buf1, buf2])
    with test_lib.ConfigOverrider({'Artifacts.netgroup_user_blacklist': ['user2', 'user3']}):
        out = list(parser.Parse(ff_result, None))
        self.assertItemsEqual([x.username for x in out], [u'user1', u'user5', u'user6'])
