Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EO Time Series Viewer
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
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
Benjamin Jakimow
EO Time Series Viewer
Commits
08603655
Commit
08603655
authored
7 years ago
by
benjamin.jakimow@geo.hu-berlin.de
Browse files
Options
Downloads
Patches
Plain Diff
addded tests/test_timeseries.py
parent
d8085c6a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_timeseries.py
+52
-0
52 additions, 0 deletions
test/test_timeseries.py
with
52 additions
and
0 deletions
test/test_timeseries.py
0 → 100644
+
52
−
0
View file @
08603655
# coding=utf-8
"""
Tests QGIS plugin init.
"""
import
os
import
unittest
import
example
from
osgeo
import
gdal
from
timeseriesviewer
import
file_search
from
timeseriesviewer.timeseries
import
TimeSeries
,
SensorInstrument
,
TimeSeriesDatum
class
TestInit
(
unittest
.
TestCase
):
def
test_timeseries
(
self
):
files
=
file_search
(
os
.
path
.
dirname
(
example
.
__file__
),
'
*.tiff
'
,
recursive
=
True
)
addedDates
=
[]
TS
=
TimeSeries
()
TS
.
sigTimeSeriesDatesAdded
.
connect
(
lambda
dates
:
addedDates
.
append
(
dates
))
TS
.
sigTimeSeriesDatesRemoved
.
connect
(
lambda
dates
:
[
addedDates
.
remove
(
d
)
for
d
in
dates
])
for
file
in
files
:
TS
.
addFiles
([
file
])
self
.
assertEqual
(
len
(
files
),
len
(
TS
))
TS
.
removeDates
(
addedDates
)
self
.
assertEquals
(
len
(
addedDates
),
0
)
def
test_sensors
(
self
):
pathRE
=
file_search
(
os
.
path
.
dirname
(
example
.
__file__
),
'
re*.tiff
'
,
recursive
=
True
)[
0
]
pathLS
=
file_search
(
os
.
path
.
dirname
(
example
.
__file__
),
'
*BOA.tiff
'
,
recursive
=
True
)[
0
]
TS
=
TimeSeries
()
TS
.
addFiles
(
pathRE
)
TS
.
addFiles
(
pathLS
)
self
.
assertEqual
(
len
(
TS
.
Sensors
),
2
)
dsRE
=
gdal
.
Open
(
pathRE
)
assert
isinstance
(
dsRE
,
gdal
.
Dataset
)
tsdRE
=
TS
.
tsdFromPath
(
pathRE
)
self
.
assertIsInstance
(
tsdRE
,
TimeSeriesDatum
)
sRE
=
tsdRE
.
sensor
self
.
assertIsInstance
(
sRE
,
SensorInstrument
)
self
.
assertEqual
(
dsRE
.
RasterCount
,
sRE
.
nb
)
def
test_datematching
(
self
):
pass
if
__name__
==
'
__main__
'
:
unittest
.
main
()
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