def test_5_document04(self):
        self.opts.update({
            'DOCUMENT': 'lsslides/tests_data/document04.md',
            '-i': True
        })
        s = LSSlides(self.opts)
        s.main()

        # check if document04 is greater than document01,
        # because it has -i option
        d1_stat = os.stat('lsslides/tests_data/document01.html')
        d4_stat = os.stat('lsslides/tests_data/document04.html')
        self.assertTrue(d4_stat.st_size > d1_stat.st_size)
 def test_6_input_string(self):
     s = LSSlides(input_string='## Slide 1\n\nbae\n\n## Slide 2\n\nsie')
     res = s.main()
     # If there is no frontmatter, do not show cover
     self.assertTrue('id="slide--cover"' not in res)
     self.assertTrue('slide--1' in res)
     self.assertTrue('slide--2' in res)
     self.assertTrue('slide--3' not in res)
    def test_1_document01(self):
        self.opts.update({'DOCUMENT': 'lsslides/tests_data/document01.md'})
        s = LSSlides(self.opts)
        s.main()

        with open('lsslides/tests_data/document01.html') as out:
            soup = out.read()
            self.assertTrue('<p class="author">' in soup)
            self.assertTrue('<p class="author-email">' in soup)
            self.assertTrue('id="slide--cover"' in soup)
            self.assertTrue('slide--1' in soup)
            self.assertTrue('slide--2' in soup)
            self.assertTrue('slide--3' in soup)
            self.assertTrue('slide--4' in soup)
            self.assertTrue('slide--5' in soup)
            self.assertTrue('slide--6' in soup)
            self.assertTrue('slide--7' not in soup)
    def test_4_nomdfile(self):
        self.opts.update({'DOCUMENT': 'lsslides/tests_data/document03.mdi'})
        s = LSSlides(self.opts)

        self.assertRaises(SystemExit, lambda: s.main())
    def test_3_nofile(self):
        self.opts.update({'DOCUMENT': 'lsslides/tests_data/nofile.md'})
        s = LSSlides(self.opts)

        self.assertRaises(SystemExit, lambda: s.main())
    def test_2_wrong_formatter(self):
        self.opts.update({'DOCUMENT': 'lsslides/tests_data/document02.md'})
        s = LSSlides(self.opts)

        self.assertRaises(SystemExit, lambda: s.main())