Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Root
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
为了安全,强烈建议开启2FA双因子认证:User Settings -> Account -> Enable two-factor authentication!!!
Show more breadcrumbs
cxwx
Root
Commits
b7bd80e5
Commit
b7bd80e5
authored
5 years ago
by
Stefan Wunsch
Committed by
Enric Tejedor
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[PyROOT experimental] Add tests for ROOT module
parent
52882d38
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bindings/pyroot_experimental/PyROOT/test/CMakeLists.txt
+3
-0
3 additions, 0 deletions
bindings/pyroot_experimental/PyROOT/test/CMakeLists.txt
bindings/pyroot_experimental/PyROOT/test/root_module.py
+46
-0
46 additions, 0 deletions
bindings/pyroot_experimental/PyROOT/test/root_module.py
with
49 additions
and
0 deletions
bindings/pyroot_experimental/PyROOT/test/CMakeLists.txt
+
3
−
0
View file @
b7bd80e5
...
@@ -4,6 +4,9 @@
...
@@ -4,6 +4,9 @@
# For the licensing terms see $ROOTSYS/LICENSE.
# For the licensing terms see $ROOTSYS/LICENSE.
# For the list of contributors see $ROOTSYS/README/CREDITS.
# For the list of contributors see $ROOTSYS/README/CREDITS.
# Test ROOT module
ROOT_ADD_PYUNITTEST
(
pyroot_root_module root_module.py
)
# General pythonizations
# General pythonizations
ROOT_ADD_PYUNITTEST
(
pyroot_pyz_pretty_printing pretty_printing.py
)
ROOT_ADD_PYUNITTEST
(
pyroot_pyz_pretty_printing pretty_printing.py
)
ROOT_ADD_PYUNITTEST
(
pyroot_pyz_array_interface array_interface.py
)
ROOT_ADD_PYUNITTEST
(
pyroot_pyz_array_interface array_interface.py
)
...
...
This diff is collapsed.
Click to expand it.
bindings/pyroot_experimental/PyROOT/test/root_module.py
0 → 100644
+
46
−
0
View file @
b7bd80e5
import
unittest
class
ROOTModule
(
unittest
.
TestCase
):
"""
Testing features of the ROOT module implemented in the ROOT module facade
"""
def
test_import
(
self
):
"""
Test import
"""
import
ROOT
self
.
assertEqual
(
ROOT
.
__name__
,
"
ROOT
"
)
def
test_relative_import
(
self
):
"""
Test relative import
"""
from
ROOT
import
TH1F
self
.
assertEqual
(
TH1F
.
__name__
,
"
TH1F
"
)
from
ROOT
import
TH1F
as
Foo
self
.
assertEqual
(
Foo
.
__name__
,
"
TH1F
"
)
self
.
assertEqual
(
TH1F
,
Foo
)
def
test_version
(
self
):
"""
Test __version__ property
"""
import
ROOT
v
=
ROOT
.
__version__
self
.
assertTrue
(
type
(
v
)
==
str
)
self
.
assertIn
(
"
/
"
,
v
)
self
.
assertIn
(
"
.
"
,
v
)
self
.
assertEqual
(
v
,
ROOT
.
gROOT
.
GetVersion
())
def
test_ignore_cmdline_options
(
self
):
"""
Test module flag to ignore command line options
"""
import
ROOT
self
.
assertEqual
(
ROOT
.
PyConfig
.
IgnoreCommandLineOptions
,
False
)
ROOT
.
PyConfig
.
IgnoreCommandLineOptions
=
True
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment