def test_get_main_article_with_references(self):
        article_paragraphs = parse_elife_xml.get_main_article(self.soup, 
                                                              keep_references=True)

        text_with_article_ref = 'removed by the proteasome (Finley, 2009). The barrel-shaped core peptidase'

        text_found_in_paragraph = text_with_article_ref in article_paragraphs[0]

        self.assertTrue(text_found_in_paragraph)
    def test_get_main_article_returns_correct_text(self):
        article_paragraphs = parse_elife_xml.get_main_article(self.soup)
        first_paragraph_start_text = 'The eukaryotic 26S proteasome is a large multi-enzyme'
        last_paragraph_end_text = 'been deposited under accession ID: 3JCK in the PDB.'

        correct_beginning = article_paragraphs[0].startswith(first_paragraph_start_text)
        correct_ending = article_paragraphs[-1].endswith(last_paragraph_end_text)

        self.assertTrue(correct_beginning)
        self.assertTrue(correct_ending)
    def test_get_main_article_with_references(self):
        article_paragraphs = parse_elife_xml.get_main_article(
            self.soup, keep_references=True)

        text_with_article_ref = 'removed by the proteasome (Finley, 2009). The barrel-shaped core peptidase'

        text_found_in_paragraph = text_with_article_ref in article_paragraphs[
            0]

        self.assertTrue(text_found_in_paragraph)
    def test_get_main_article_returns_correct_text(self):
        article_paragraphs = parse_elife_xml.get_main_article(self.soup)
        first_paragraph_start_text = 'The eukaryotic 26S proteasome is a large multi-enzyme'
        last_paragraph_end_text = 'been deposited under accession ID: 3JCK in the PDB.'

        correct_beginning = article_paragraphs[0].startswith(
            first_paragraph_start_text)
        correct_ending = article_paragraphs[-1].endswith(
            last_paragraph_end_text)

        self.assertTrue(correct_beginning)
        self.assertTrue(correct_ending)
    def test_get_main_article_without_references_figure_ref_removed(self):
        ''' Checks that figure references were correctly removed from text
        '''

        article_paragraphs = parse_elife_xml.get_main_article(
            self.soup, keep_references=False)

        text_with_figure_ref = 'determined by cryo-electron microscopy (cryoEM), revealing the molecular'

        text_found_in_paragraph = text_with_figure_ref in article_paragraphs[3]

        self.assertTrue(text_found_in_paragraph)
    def test_get_main_article_without_references_figure_ref_removed(self):

        ''' Checks that figure references were correctly removed from text
        '''

        article_paragraphs = parse_elife_xml.get_main_article(self.soup, 
                                                              keep_references=False)

        text_with_figure_ref = 'determined by cryo-electron microscopy (cryoEM), revealing the molecular'

        text_found_in_paragraph = text_with_figure_ref in article_paragraphs[3]

        self.assertTrue(text_found_in_paragraph)
    def test_get_main_article_without_references_article_ref_removed(self):

        ''' Checks that article references were correctly removed from text
        '''

        article_paragraphs = parse_elife_xml.get_main_article(self.soup, 
                                                              keep_references=False)

        text_with_article_ref = 'removed by the proteasome. The barrel-shaped core peptidase'

        text_found_in_paragraph = text_with_article_ref in article_paragraphs[0]

        self.assertTrue(text_found_in_paragraph)
    def test_get_main_article_without_references_article_ref_removed(self):
        ''' Checks that article references were correctly removed from text
        '''

        article_paragraphs = parse_elife_xml.get_main_article(
            self.soup, keep_references=False)

        text_with_article_ref = 'removed by the proteasome. The barrel-shaped core peptidase'

        text_found_in_paragraph = text_with_article_ref in article_paragraphs[
            0]

        self.assertTrue(text_found_in_paragraph)
 def test_get_correct_number_of_main_article_paragraphs(self):
     article_paragraphs = parse_elife_xml.get_main_article(self.soup, 
                                                           keep_references=True)
     
     self.assertEqual(len(article_paragraphs), 59)
    def test_get_correct_number_of_main_article_paragraphs(self):
        article_paragraphs = parse_elife_xml.get_main_article(
            self.soup, keep_references=True)

        self.assertEqual(len(article_paragraphs), 59)