def test_sibling_build_files(self):
    self.add_to_build_file('BUILD', dedent('\n      fake(name="base",\n           dependencies=[\n             \':foo\',\n           ])\n      '))
    self.add_to_build_file('BUILD.foo', dedent('\n      fake(name="foo",\n           dependencies=[\n             \':bat\',\n           ])\n      '))
    self.add_to_build_file('./BUILD.bar', dedent('\n      fake(name="bat")\n      '))
    bar_build_file = self.create_buildfile('BUILD.bar')
    base_build_file = self.create_buildfile('BUILD')
    foo_build_file = self.create_buildfile('BUILD.foo')
    address_map = self.build_file_parser.address_map_from_build_files(BuildFile.get_build_files_family(FileSystemProjectTree(self.build_root), '.'))
    addresses = address_map.keys()
    self.assertEqual({bar_build_file.relpath, base_build_file.relpath, foo_build_file.relpath}, set([address.rel_path for address in addresses]))
    self.assertEqual({'//:base', '//:foo', '//:bat'}, set([address.spec for address in addresses]))
def test_sibling_build_files(self):
    self.add_to_build_file('BUILD', dedent('\n      fake(name="base",\n           dependencies=[\n             \':foo\',\n           ])\n      '))
    self.add_to_build_file('BUILD.foo', dedent('\n      fake(name="foo",\n           dependencies=[\n             \':bat\',\n           ])\n      '))
    self.add_to_build_file('./BUILD.bar', dedent('\n      fake(name="bat")\n      '))
    bar_build_file = self.create_buildfile('BUILD.bar')
    base_build_file = self.create_buildfile('BUILD')
    foo_build_file = self.create_buildfile('BUILD.foo')
    address_map = self.build_file_parser.address_map_from_build_files(BuildFile.get_build_files_family(FileSystemProjectTree(self.build_root), '.'))
    addresses = address_map.keys()
    self.assertEqual({bar_build_file.relpath, base_build_file.relpath, foo_build_file.relpath}, set([address.rel_path for address in addresses]))
    self.assertEqual({'//:base', '//:foo', '//:bat'}, set([address.spec for address in addresses]))