Belle II Software
light-2212-foldex
Main Page
Modules
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
Variables
Typedefs
a
b
c
d
l
m
n
p
r
s
w
Enumerations
Enumerator
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
c
d
e
f
h
i
m
o
p
r
s
t
v
w
Enumerations
b
c
e
g
h
m
p
s
t
v
Enumerator
b
c
k
t
Related Functions
Files
File List
File Members
All
Functions
test_embedding_example.py
1
#!/usr/bin/env python3
2
# -*- coding: utf-8 -*-
3
4
11
12
import
os
13
import
sys
14
import
subprocess
15
import
unittest
16
from
basf2
import
find_file
17
from
b2test_utils
import
clean_working_directory
18
19
20
class
TestEmbedding
(unittest.TestCase):
21
"""Test to run the embedding example."""
22
23
@unittest.skipIf(not os.getenv('BELLE2_EXAMPLES_DATA_DIR')
,
24
"$BELLE2_EXAMPLES_DATA_DIR not found."
)
25
def
testEmbedding
(self):
26
"""
27
Test the embedding example.
28
"""
29
embedding_example = find_file(
'analysis/examples/embedding/embedding.py'
)
30
31
result = subprocess.run([
'basf2'
, embedding_example], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
32
if
result.returncode != 0:
33
# failure running tutorial so let's print the output
34
# on stderr so it's not split from output of unittest
35
# done like this since we don't want to decode/encode utf8
36
sys.stdout.buffer.write(result.stdout)
37
38
self.assertEqual(result.returncode, 0)
39
40
41
if
__name__ ==
'__main__'
:
42
with
clean_working_directory():
43
unittest.main()
test_embedding_example.TestEmbedding
Definition:
test_embedding_example.py:20
test_embedding_example.TestEmbedding.testEmbedding
def testEmbedding(self)
Definition:
test_embedding_example.py:25
analysis
tests
test_embedding_example.py
Generated on Sun Jan 15 2023 23:30:52 for Belle II Software by
1.9.1