Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
KM3NeT TestData
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
Container 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
Show more breadcrumbs
km3py
KM3NeT TestData
Commits
4354bc0d
Commit
4354bc0d
authored
4 years ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Add tests for latest function
parent
8bf3ea7f
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
tests/test_core.py
+17
-2
17 additions, 2 deletions
tests/test_core.py
with
17 additions
and
2 deletions
tests/test_core.py
+
17
−
2
View file @
4354bc0d
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import
os
import
unittest
from
km3net_testdata
import
data_path
from
km3net_testdata
import
data_path
,
latest
,
LATEST_VERSIONS
class
TestDataPath
(
unittest
.
TestCase
):
def
test_access
(
self
):
assert
data_path
(
"
km3net_offline.root
"
).
endswith
(
"
km3net_offline.root
"
)
assert
data_path
(
"
km3net_online.root
"
).
endswith
(
"
km3net_online.root
"
)
def
test_accessing_nonexistent_files
(
self
):
with
self
.
assertRaises
(
RuntimeError
):
data_path
(
"
nonexistent_file
"
)
def
test_filename_returned_if_raise_missing_is_false
(
self
):
filename
=
"
nonexistent_file
"
assert
data_path
(
filename
,
raise_missing
=
False
).
endswith
(
filename
)
class
TestLatest
(
unittest
.
TestCase
):
def
test_latest_paths
(
self
):
for
dataformat
in
LATEST_VERSIONS
.
keys
():
assert
latest
(
dataformat
).
endswith
(
LATEST_VERSIONS
[
dataformat
])
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