Belle II Software
release-05-02-19
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
k
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
u
v
w
x
z
Typedefs
a
b
c
d
e
h
i
l
m
n
p
r
s
t
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
# -*- coding: utf-8 -*-
3
4
import
unittest
5
import
os
6
import
validationfunctions
7
import
tempfile
8
9
call_iteration = 0
10
11
12
class
ValidationFunctionstTest
(unittest.TestCase):
13
14
"""
15
Various test cases for the validation utility functions
16
"""
17
18
def
test_git_hash
(self):
19
"""
20
Test if the extraction of the git hash works and if not, if the
21
functions returns the expected result
22
"""
23
24
# fixme: disabled for now
25
# test disabled for now, until a way to run this properly on the
26
# build bot can be found
27
return
28
# noinspection PyUnreachableCode
29
30
cwd = os.getcwd()
31
32
with
tempfile.TemporaryDirectory()
as
td:
33
# switch to this folder
34
os.chdir(str(td))
35
ret =
validationfunctions.get_compact_git_hash
(os.getcwd())
36
self.assertTrue(ret
is
None
)
37
38
os.chdir(cwd)
39
40
# in the source folder, we should get a sensible output
41
local_dir = os.environ.get(
'BELLE2_LOCAL_DIR'
,
None
)
42
if
local_dir:
43
ret =
validationfunctions.get_compact_git_hash
(local_dir)
44
self.assertTrue(ret
is
not
None
)
45
print(
"This source code has git hash {}"
.format(ret))
46
47
48
if
__name__ ==
"__main__"
:
49
unittest.main()
validationfunctions.get_compact_git_hash
Optional[str] get_compact_git_hash(str repo_folder)
Definition:
validationfunctions.py:44
test_validationfunctions.ValidationFunctionstTest
Definition:
test_validationfunctions.py:12
test_validationfunctions.ValidationFunctionstTest.test_git_hash
def test_git_hash(self)
Definition:
test_validationfunctions.py:18
validation
tests
test_validationfunctions.py
Generated on Tue Jan 4 2022 03:11:17 for Belle II Software by
1.8.17