Esempio n. 1
0
 def test_process_paragraphs_type_1(self):
     markdown = process_paragraphs(self.paragraphs[1:2])
     expected = ['\nYou need use Web Components in the your application? No you don’t need. '\
                 'I’am totally against from the hype. You should use if only you need. I see some '\
                 'advantages to use if you really need. For example: componentization and your '\
                 'advantages, very small final bundle size and etc.\n']
     self.assertEqual(expected, markdown)
Esempio n. 2
0
    def test_process_paragraphs_with_same_word_in_phrase(self):
        markdown = process_paragraphs(self.paragraphs[23:24])
        expected = ['\nWhy will use **Redux**? Using **Redux** my code became is very simple and very easy to get data '\
                    'an another components. With it my problems for events control is over as like bugs create by we '\
                    'on the migration progress (**Vanilla** > **Web Components**) haha.\n']

        self.assertEqual(expected, markdown)
Esempio n. 3
0
    def test_process_paragraphs_type_11_gist(self, mock_get_embed_media):
        mock_get_embed_media.return_value.text = read_files(
            'response_media_gist_text.txt')

        markdown = process_paragraphs(self.paragraphs[8:9])
        expected = '<script src="https://gist.github.com/leidsondias/fec20e1535c4bb832a85321f84fb08d9.js"></script>'
        self.assertTrue(expected in markdown[0])
Esempio n. 4
0
 def test_process_paragraphs_type_11_twitter(self):
     # multiples mocks here
     markdown = process_paragraphs(self.paragraphs[71:72])
     expected = ['\n<blockquote class="twitter-tweet"><p lang="pt" dir="ltr">Só Vem, Amigos!!! RT <a href="https:'\
                 '//t.co/z9DFfPHN3s">https://t.co/z9DFfPHN3s</a> <a href="https://t.co/F0151AeovH">pic.twitter.com/'\
                 'F0151AeovH</a></p>&mdash; FIFA TRADE CHANNEL Oficial 🌀 (@FIFATRADECHANN1) <a href="https://twitt'\
                 'er.com/FIFATRADECHANN1/status/1057437847274303488?ref_src=twsrc%5Etfw">October 31, 2018</a></bloc'\
                 'kquote>\n<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>\n\n']
     self.assertEqual(markdown, expected)
Esempio n. 5
0
 def test_process_paragraphs_type_11_youtube(self, mock_get_embed_media):
     mock_get_embed_media.return_value.text = read_files(
         'response_media_youtube_text.txt')
     markdown = process_paragraphs(self.paragraphs[69:70])
     expected = ['\n<iframe width="560" height="315" src="https://cdn.embedly.com/widgets/media.html?src=https%3A'\
                 '%2F%2Fwww.youtube.com%2Fembed%2FN6ZfqHGeN9Q%3Fstart%3D4631%26feature%3Doembed%26start%3D4631&ur'\
                 'l=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DN6ZfqHGeN9Q&image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F'\
                 'N6ZfqHGeN9Q%2Fhqdefault.jpg&key=a19fcc184b9711e1b4764040d3dc5c07&type=text%2Fhtml&schema=youtube'\
                 '" frameborder="0" allowfullscreen></iframe>\n']
     self.assertEqual(markdown, expected)
Esempio n. 6
0
 def test_process_paragraphs_type_4(self):
     markdown = process_paragraphs(self.paragraphs[66:67])
     expected = ['\n![cap da imagem](https://cdn-images-1.medium.com/max/2744/1*X-X8xve-7LRf2f_IVhQCbg.png)*cap '\
                 'da imagem*\n']
     self.assertEqual(markdown, expected)
Esempio n. 7
0
 def test_process_paragraphs_type_3(self):
     markdown = process_paragraphs(self.paragraphs[:1])
     self.assertEqual(['\n## Web Components with Redux\n'], markdown)
Esempio n. 8
0
 def test_process_paragraph_with_multiples_markups_in_same_word(self):
     markdown = process_paragraphs(self.paragraphs[6:7])
     print(markdown)
Esempio n. 9
0
 def test_process_paragraphs_markup_type_10(self):
     markdown = process_paragraphs(self.paragraphs[72:73])
     expected = ['\n`code aqui amigo` e aqui:\n']
     self.assertEqual(markdown, expected)
Esempio n. 10
0
 def test_process_paragraphs_markup_type_3(self):
     markdown = process_paragraphs(self.paragraphs[75:76])
     expected = '[https://domchristie.github.io/turndown/](https://domchristie.github.io/turndown/)'
     self.assertTrue(expected in markdown[0])
Esempio n. 11
0
 def test_process_paragraphs_markup_type_2(self):
     markdown = process_paragraphs(self.paragraphs[6:7])
     expected = '*name, oldValue *and* newValue*'
     self.assertTrue(expected in markdown[0])
Esempio n. 12
0
 def test_process_paragraphs_markup_type_1(self):
     markdown = process_paragraphs(self.paragraphs[2:3])
     expected = '**Stories** like **Instagram**'
     self.assertTrue(expected in markdown[0])
Esempio n. 13
0
 def test_process_paragraphs_type_8(self):
     markdown = process_paragraphs(self.paragraphs[73:74])
     expected = ['\n```\nTeste de code aqui sem syntex highligh\n```\n']
     self.assertEqual(markdown, expected)
Esempio n. 14
0
 def test_process_paragraphs_type_6(self):
     markdown = process_paragraphs(self.paragraphs[68:69])
     expected = ['\n>quotes de alguém com youtube abaixo\n']
     self.assertEqual(markdown, expected)