<commit_before>import unittest
from igf_data.illumina.runinfo_xml import RunInfo_xml

class Hiseq4000RunInfo(unittest.TestCase):

  def setUp(self):
    r_file='doc/data/Illumina/RunInfo.xml'
    self.runinfo_data=RunInfo_xml(xml_file=r_file)

  def test_runInfo_wrong_root_tag(self):
    runinfo_data=self.runinfo_data
    with self.assertRaises(ValueError):
      runinfo_data.get_reads_stats(root_tag='NO_Read')

  def test_get_platform_number(self):
    runinfo_data=self.runinfo_data
    platform_number=runinfo_data.get_platform_number()
    self.assertEqual(platform_number, 'K00001')

  def test_get_reads_stats(self):
    runinfo_data=self.runinfo_data
    reads_stats=runinfo_data.get_reads_stats()
    self.assertEqual(len(reads_stats), 4)

    index_count=0
    read_count=0
    index_len=8
    read_len=151

    for read_id in reads_stats.keys():<commit_msg>replaced xml parsing by bs4 and updated the tests<commit_after>import unittest
from igf_data.illumina.runinfo_xml import RunInfo_xml

class Hiseq4000RunInfo(unittest.TestCase):

  def setUp(self):
    r_file='/home/vmuser/git_code/data-management-python/doc/data/Illumina/RunInfo.xml'
    self.runinfo_data=RunInfo_xml(xml_file=r_file)

  def test_runInfo_wrong_root_tag(self):
    runinfo_data=self.runinfo_data
    with self.assertRaises(ValueError):
      runinfo_data.get_reads_stats(root_tag='NO_Read')

  def test_get_platform_number(self):
    runinfo_data=self.runinfo_data
    platform_number=runinfo_data.get_platform_number()
    self.assertEqual(platform_number, 'K00001')

  def test_get_reads_stats(self):
    runinfo_data=self.runinfo_data
    reads_stats=runinfo_data.get_reads_stats()
    self.assertEqual(len(reads_stats), 4)

    index_count=0
    read_count=0
    index_len=8
    read_len=151

    for read_id in reads_stats.keys():
{'fraction_non_alphanumeric': 0.08831596269884805, 'fraction_numerical': 0.018102029621503018, 'mean_word_length': 5.333333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 11}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '780501', 'n_tokens_mistral': 696, 'n_tokens_neox': 646, 'n_words': 83}