Page MenuHomec4science

test_snippet_helper.py
No OneTemporary

File Metadata

Created
Thu, Apr 25, 14:00

test_snippet_helper.py

#!/bin/env python3
from __future__ import print_function
import unittest
class SnippetHelperTest(unittest.TestCase):
"Unit tests for SnippetHelper"
def setUp(self, ):
pass
def test_cpp_snippet(self):
from Slides import snippet_helper as sh
sh.Snippet.default_line_number = True
sh.Snippet.default_output = 'latex'
snip = sh.Snippet('tests/snippet.cpp')
snip.save('snippet2.cpp')
f = open('snippet2.cpp')
snip2 = f.read()
f.close()
if snip.get_content() != snip2:
print('AAA ', snip.get_content())
print('BBB ', snip2)
raise RuntimeError('failed test')

Event Timeline