Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F59843124
test_snippet_helper.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Apr 25, 14:00
Size
685 B
Mime Type
text/x-python
Expires
Sat, Apr 27, 14:00 (2 d)
Engine
blob
Format
Raw Data
Handle
17256007
Attached To
R3683 Slides
test_snippet_helper.py
View Options
#!/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
Log In to Comment