'Write TAP reports to file.'

def _write_reports(self):

    for key in self._reports_container.keys():
        if (key == 'root'):
            sub_dir = ''
        else:
            sub_dir = key
        tap_fh = open((os.sep.join([self.resultdir, sub_dir, self.global_filename]) + '.tap'), 'w')
        tap_fh.write((('1..' + str(len(self._reports_container[key]))) + '\n'))
        tap_fh.writelines(self._reports_container[key])
        tap_fh.close()
