Jpp
21.0.0
the software that should make you happy
Loading...
Searching...
No Matches
externals
km3net-dataformat
build
km3net_testdata
tests
test_core.py
Go to the documentation of this file.
1
#!/usr/bin/env python3
2
# -*- coding: utf-8 -*-
3
import
os
4
import
unittest
5
6
from
km3net_testdata
import
data_path, latest, LATEST_VERSIONS
7
8
9
class
TestDataPath
(unittest.TestCase):
10
def
test_access
(self):
11
assert
data_path(
"online/km3net_online.root"
).endswith(
"km3net_online.root"
)
12
13
def
test_accessing_nonexistent_files
(self):
14
with
self.assertRaises(RuntimeError):
15
data_path(
"nonexistent_file"
)
16
17
def
test_filename_returned_if_raise_missing_is_false
(self):
18
filename =
"nonexistent_file"
19
assert
data_path(filename, raise_missing=
False
).endswith(filename)
20
21
22
class
TestLatest
(unittest.TestCase):
23
def
test_latest_paths
(self):
24
for
dataformat
in
LATEST_VERSIONS.keys():
25
assert
latest(dataformat).endswith(LATEST_VERSIONS[dataformat])
test_core.TestDataPath
Definition
test_core.py:9
test_core.TestDataPath.test_access
test_access(self)
Definition
test_core.py:10
test_core.TestDataPath.test_filename_returned_if_raise_missing_is_false
test_filename_returned_if_raise_missing_is_false(self)
Definition
test_core.py:17
test_core.TestDataPath.test_accessing_nonexistent_files
test_accessing_nonexistent_files(self)
Definition
test_core.py:13
test_core.TestLatest
Definition
test_core.py:22
test_core.TestLatest.test_latest_paths
test_latest_paths(self)
Definition
test_core.py:23
Generated by
1.12.0