Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zolfa-nd2reader
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Show more breadcrumbs
Lorenzo ZOLFANELLI
zolfa-nd2reader
Commits
bacf6a91
Commit
bacf6a91
authored
1 year ago
by
Lorenzo ZOLFANELLI
Browse files
Options
Downloads
Patches
Plain Diff
test: fix wrong assertEquals calls
parent
aecc3b9e
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
tests/test_common.py
+2
-2
2 additions, 2 deletions
tests/test_common.py
tests/test_legacy.py
+4
-4
4 additions, 4 deletions
tests/test_legacy.py
tests/test_raw_metadata.py
+1
-1
1 addition, 1 deletion
tests/test_raw_metadata.py
tests/test_reader.py
+1
-1
1 addition, 1 deletion
tests/test_reader.py
with
8 additions
and
8 deletions
tests/test_common.py
+
2
−
2
View file @
bacf6a91
...
@@ -134,7 +134,7 @@ class TestCommon(unittest.TestCase):
...
@@ -134,7 +134,7 @@ class TestCommon(unittest.TestCase):
# The chunk metadata is always 16 bytes long
# The chunk metadata is always 16 bytes long
chunk_metadata
=
real_data
.
read
(
16
)
chunk_metadata
=
real_data
.
read
(
16
)
header
,
relative_offset
,
data_length
=
struct
.
unpack
(
"
IIQ
"
,
chunk_metadata
)
header
,
relative_offset
,
data_length
=
struct
.
unpack
(
"
IIQ
"
,
chunk_metadata
)
self
.
assertEqual
s
(
header
,
0xabeceda
)
self
.
assertEqual
(
header
,
0xabeceda
)
# We start at the location of the chunk metadata, skip over the metadata, and then proceed to the
# We start at the location of the chunk metadata, skip over the metadata, and then proceed to the
# start of the actual data field, which is at some arbitrary place after the metadata.
# start of the actual data field, which is at some arbitrary place after the metadata.
...
@@ -152,4 +152,4 @@ class TestCommon(unittest.TestCase):
...
@@ -152,4 +152,4 @@ class TestCommon(unittest.TestCase):
with
self
.
assertRaises
(
ValueError
)
as
context
:
with
self
.
assertRaises
(
ValueError
)
as
context
:
read_chunk
(
fh
,
chunk_location
+
1
)
read_chunk
(
fh
,
chunk_location
+
1
)
self
.
assertEqual
s
(
str
(
context
.
exception
),
"
The ND2 file seems to be corrupted.
"
)
self
.
assertEqual
(
str
(
context
.
exception
),
"
The ND2 file seems to be corrupted.
"
)
This diff is collapsed.
Click to expand it.
tests/test_legacy.py
+
4
−
4
View file @
bacf6a91
...
@@ -15,7 +15,7 @@ class TestLegacy(unittest.TestCase):
...
@@ -15,7 +15,7 @@ class TestLegacy(unittest.TestCase):
with
Nd2
(
'
test_data/legacy.nd2
'
)
as
reader
:
with
Nd2
(
'
test_data/legacy.nd2
'
)
as
reader
:
self
.
assertIsInstance
(
reader
.
reader
,
ND2Reader
)
self
.
assertIsInstance
(
reader
.
reader
,
ND2Reader
)
self
.
assertTrue
(
issubclass
(
w
[
0
].
category
,
DeprecationWarning
))
self
.
assertTrue
(
issubclass
(
w
[
0
].
category
,
DeprecationWarning
))
self
.
assertEqual
s
(
str
(
w
[
0
].
message
),
"
The
'
Nd2
'
class is deprecated, please consider using the new
"
+
self
.
assertEqual
(
str
(
w
[
0
].
message
),
"
The
'
Nd2
'
class is deprecated, please consider using the new
"
+
"
ND2Reader interface which uses pims.
"
)
"
ND2Reader interface which uses pims.
"
)
def
test_misc
(
self
):
def
test_misc
(
self
):
...
@@ -30,9 +30,9 @@ class TestLegacy(unittest.TestCase):
...
@@ -30,9 +30,9 @@ class TestLegacy(unittest.TestCase):
"
Fields of View: %s
"
%
len
(
reader
.
fields_of_view
),
"
Fields of View: %s
"
%
len
(
reader
.
fields_of_view
),
"
Z-Levels: %s
"
%
len
(
reader
.
z_levels
)
"
Z-Levels: %s
"
%
len
(
reader
.
z_levels
)
])
])
self
.
assertEqual
s
(
representation
,
str
(
reader
))
self
.
assertEqual
(
representation
,
str
(
reader
))
# not implemented yet
# not implemented yet
self
.
assertEqual
s
(
reader
.
pixel_microns
,
None
)
self
.
assertEqual
(
reader
.
pixel_microns
,
None
)
self
.
assertEqual
s
(
len
(
reader
),
1
)
self
.
assertEqual
(
len
(
reader
),
1
)
This diff is collapsed.
Click to expand it.
tests/test_raw_metadata.py
+
1
−
1
View file @
bacf6a91
...
@@ -77,4 +77,4 @@ class TestRawMetadata(unittest.TestCase):
...
@@ -77,4 +77,4 @@ class TestRawMetadata(unittest.TestCase):
def
test_color_channels
(
self
):
def
test_color_channels
(
self
):
parsed_channels
=
self
.
metadata
.
get_parsed_metadata
()[
'
channels
'
]
parsed_channels
=
self
.
metadata
.
get_parsed_metadata
()[
'
channels
'
]
self
.
assertEqual
s
(
parsed_channels
,
[
'
TRITC
'
])
self
.
assertEqual
(
parsed_channels
,
[
'
TRITC
'
])
This diff is collapsed.
Click to expand it.
tests/test_reader.py
+
1
−
1
View file @
bacf6a91
...
@@ -54,7 +54,7 @@ class TestReader(unittest.TestCase):
...
@@ -54,7 +54,7 @@ class TestReader(unittest.TestCase):
with
ArtificialND2
(
'
test_data/test_nd2_reader.nd2
'
)
as
_
:
with
ArtificialND2
(
'
test_data/test_nd2_reader.nd2
'
)
as
_
:
with
ND2Reader
(
'
test_data/test_nd2_reader.nd2
'
)
as
reader
:
with
ND2Reader
(
'
test_data/test_nd2_reader.nd2
'
)
as
reader
:
timesteps
=
reader
.
timesteps
timesteps
=
reader
.
timesteps
self
.
assertEqual
s
(
len
(
timesteps
),
0
)
self
.
assertEqual
(
len
(
timesteps
),
0
)
def
test_get_frame_zero
(
self
):
def
test_get_frame_zero
(
self
):
# Best test we can do for now:
# Best test we can do for now:
...
...
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