File size: 1,212 Bytes
8b32433
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import unittest
from bs4 import BeautifulSoup
import app

class BeautifulSoupTest(unittest.TestCase):
    def test_beautiful_soup(self):
        self.assertTrue(True)

    def test_main_tag(self):
        html = '''
        <html>
            <head>  </head>
            <body>
                <main>
                    <div>
                        <ul>
                            <li><a href="https://www.cms.gov/Medicare/Billing/ElectronicBillingEDITrans">Electronic Billing</a></li>
                            <li><a href="https://www.cms.gov/Medicare/Billing/BillingFAQs">Billing FAQs</a></li>
                        </ul>
                    </div>
                    <div>
                        <div>
                            <p>Paragraph</p>
                            <ul>
                                <li>List Item</li>
                            </ul>
                            Text within div
                        </div>
                    </div>
                </main>
            </body>
        </html>
        '''
        soup = BeautifulSoup(html, 'html.parser')
        self.assertEqual( app.get_main( soup ).name, 'main' )

if __name__ == '__main__':
    unittest.main()