Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tomotools
tomoscan
Commits
3e31fcd9
Commit
3e31fcd9
authored
Apr 09, 2021
by
payno
Browse files
improve code coverage
parent
e2abf744
Pipeline
#44550
passed with stages
in 11 minutes and 26 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.coveragerc
0 → 100644
View file @
3e31fcd9
[run]
omit = [
*setup.py,
]
.gitignore
View file @
3e31fcd9
...
...
@@ -45,6 +45,9 @@ test10/
h5_datasets/
*.egg-info*
.coverage
.coverage.PC*
# notebook checkpoints
*.ipynb_checkpoints/
...
...
tomoscan/esrf/test/__init__.py
deleted
100644 → 0
View file @
e2abf744
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2017 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# ###########################################################################*/
__authors__
=
[
"H.Payno"
]
__license__
=
"MIT"
__date__
=
"21/08/2020"
import
unittest
from
.test_hdf5scan
import
suite
as
h5_test_suite
from
.test_edfscan
import
suite
as
edf_test_suite
from
.test_mock
import
suite
as
mock_test_suite
def
suite
():
test_suite
=
unittest
.
TestSuite
()
test_suite
.
addTest
(
h5_test_suite
())
test_suite
.
addTest
(
edf_test_suite
())
test_suite
.
addTest
(
mock_test_suite
())
return
test_suite
tomoscan/esrf/test/test_edfscan.py
View file @
3e31fcd9
...
...
@@ -622,25 +622,3 @@ class TestIgnoredProjections(unittest.TestCase):
idx
in
scan
.
projections
,
"Projection index %d is supposed to be ignored"
%
idx
,
)
def
suite
():
test_suite
=
unittest
.
TestSuite
()
for
ui
in
(
TestScanFactory
,
TestDarksFlats
,
TestScanValidatorFindFiles
,
TestRadioPath
,
TestProjections
,
TestTomoBaseHashable
,
TestOriDarksFlats
,
TestFlatFieldCorrection
,
TestGetSinogram
,
TestIgnoredProjections
,
):
test_suite
.
addTest
(
unittest
.
defaultTestLoader
.
loadTestsFromTestCase
(
ui
))
return
test_suite
if
__name__
==
"__main__"
:
unittest
.
main
(
defaultTest
=
"suite"
)
tomoscan/esrf/test/test_hdf5scan.py
View file @
3e31fcd9
...
...
@@ -465,20 +465,3 @@ class TestGetSinogramLegacy(unittest.TestCase):
)
numpy
.
testing
.
assert_array_equal
(
corrected
,
sinogram_new
)
numpy
.
testing
.
assert_array_equal
(
sinogram_old
,
sinogram_new
)
def
suite
():
test_suite
=
unittest
.
TestSuite
()
for
ui
in
(
TestHDF5Scan
,
TestFlatFieldCorrection
,
TestGetSinogram
,
TestIgnoredProjections
,
TestGetSinogramLegacy
,
):
test_suite
.
addTest
(
unittest
.
defaultTestLoader
.
loadTestsFromTestCase
(
ui
))
return
test_suite
if
__name__
==
"__main__"
:
unittest
.
main
(
defaultTest
=
"suite"
)
tomoscan/esrf/test/test_mock.py
View file @
3e31fcd9
...
...
@@ -209,14 +209,3 @@ class TestMockHDF5(unittest.TestCase):
self
.
assertTrue
(
0
in
mock
.
scan
.
darks
.
keys
())
self
.
assertTrue
(
1
in
mock
.
scan
.
flats
.
keys
())
self
.
assertTrue
(
10
in
mock
.
scan
.
flats
.
keys
())
def
suite
():
test_suite
=
unittest
.
TestSuite
()
for
ui
in
(
TestMockHDF5
,
TestMockEDFScan
):
test_suite
.
addTest
(
unittest
.
defaultTestLoader
.
loadTestsFromTestCase
(
ui
))
return
test_suite
if
__name__
==
"__main__"
:
unittest
.
main
(
defaultTest
=
"suite"
)
tomoscan/test/__init__.py
View file @
3e31fcd9
# coding: utf-8
# /*##########################################################################
# Copyright (C) 2016 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
#############################################################################*/
__authors__
=
[
"H.Payno"
]
__license__
=
"MIT"
__date__
=
"15/05/2017"
import
unittest
from
..esrf
import
test
as
esrf_test
from
.
import
test_factory
from
.
import
test_scanbase
def
suite
(
loader
=
None
):
test_suite
=
unittest
.
TestSuite
()
test_suite
.
addTest
(
esrf_test
.
suite
())
test_suite
.
addTest
(
test_factory
.
suite
())
test_suite
.
addTest
(
test_scanbase
.
suite
())
return
test_suite
if
__name__
==
"__main__"
:
unittest
.
main
(
defaultTest
=
"suite"
)
tomoscan/test/test_factory.py
View file @
3e31fcd9
...
...
@@ -30,10 +30,10 @@ __date__ = "24/01/2017"
import
unittest
import
os
from
.
.esrf.edfscan
import
EDFTomoScan
from
.
.esrf.hdf5scan
import
HDF5TomoScan
from
.
.scanfactory
import
ScanFactory
from
.utils
import
UtilsTest
from
tomoscan
.esrf.edfscan
import
EDFTomoScan
from
tomoscan
.esrf.hdf5scan
import
HDF5TomoScan
from
tomoscan
.scanfactory
import
ScanFactory
from
tomoscan.test
.utils
import
UtilsTest
import
tempfile
...
...
@@ -88,14 +88,3 @@ class TestScanFactory(unittest.TestCase):
self
.
assertEqual
(
scan
.
path
,
os
.
path
.
dirname
(
master_file
))
self
.
assertEqual
(
scan
.
master_file
,
master_file
)
self
.
assertEqual
(
scan
.
entry
,
scan_entry
)
def
suite
():
test_suite
=
unittest
.
TestSuite
()
for
ui
in
(
TestScanFactory
,):
test_suite
.
addTest
(
unittest
.
defaultTestLoader
.
loadTestsFromTestCase
(
ui
))
return
test_suite
if
__name__
==
"__main__"
:
unittest
.
main
(
defaultTest
=
"suite"
)
tomoscan/test/test_scanbase.py
View file @
3e31fcd9
...
...
@@ -111,14 +111,3 @@ class TestFlatFieldCorrection(unittest.TestCase):
projections_keys
=
[
key
for
key
in
self
.
scan
.
projections
.
keys
()]
projections_urls
=
[
self
.
scan
.
projections
[
key
]
for
key
in
projections_keys
]
self
.
scan
.
flat_field_correction
(
projections_urls
,
projections_keys
)
def
suite
():
test_suite
=
unittest
.
TestSuite
()
for
ui
in
(
TestFlatFieldCorrection
,):
test_suite
.
addTest
(
unittest
.
defaultTestLoader
.
loadTestsFromTestCase
(
ui
))
return
test_suite
if
__name__
==
"__main__"
:
unittest
.
main
(
defaultTest
=
"suite"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment