Belle II Software
release-06-02-00
Main Page
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
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
w
x
z
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
w
z
Typedefs
a
b
c
d
e
i
k
l
m
n
p
r
s
t
u
v
w
Enumerations
Enumerator
c
d
f
p
t
u
v
w
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
_
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
Enumerations
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
Enumerator
a
b
c
d
e
f
g
h
k
l
m
n
o
p
r
s
t
u
v
w
z
Related Functions
b
c
d
g
i
o
r
s
t
Files
File List
File Members
All
Functions
test_validationfunctions.py
1
#!/usr/bin/env python3
2
3
10
11
import
unittest
12
import
os
13
import
validationfunctions
14
import
tempfile
15
16
call_iteration = 0
17
18
19
class
ValidationFunctionstTest
(unittest.TestCase):
20
21
"""
22
Various test cases for the validation utility functions
23
"""
24
25
def
test_git_hash
(self):
26
"""
27
Test if the extraction of the git hash works and if not, if the
28
functions returns the expected result
29
"""
30
31
# fixme: disabled for now
32
# test disabled for now, until a way to run this properly on the
33
# build bot can be found
34
return
35
# noinspection PyUnreachableCode
36
37
cwd = os.getcwd()
38
39
with
tempfile.TemporaryDirectory()
as
td:
40
# switch to this folder
41
os.chdir(str(td))
42
ret =
validationfunctions.get_compact_git_hash
(os.getcwd())
43
self.assertTrue(ret
is
None
)
44
45
os.chdir(cwd)
46
47
# in the source folder, we should get a sensible output
48
local_dir = os.environ.get(
"BELLE2_LOCAL_DIR"
,
None
)
49
if
local_dir:
50
ret =
validationfunctions.get_compact_git_hash
(local_dir)
51
self.assertTrue(ret
is
not
None
)
52
print(f
"This source code has git hash {ret}"
)
53
54
55
if
__name__ ==
"__main__"
:
56
unittest.main()
test_validationfunctions.ValidationFunctionstTest
Definition:
test_validationfunctions.py:19
test_validationfunctions.ValidationFunctionstTest.test_git_hash
def test_git_hash(self)
Definition:
test_validationfunctions.py:25
validationfunctions.get_compact_git_hash
Optional[str] get_compact_git_hash(str repo_folder)
Definition:
validationfunctions.py:52
validation
tests
test_validationfunctions.py
Generated on Thu Dec 28 2023 02:41:29 for Belle II Software by
1.9.1