-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_src_prov.py
53 lines (43 loc) 路 1.22 KB
/
test_src_prov.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
__author__ = "Vini Salazar"
__license__ = "MIT"
__maintainer__ = "Vini Salazar"
__url__ = "https://github.com/vinisalazar/bioprov"
__version__ = "0.1.18a"
"""
Testing for prov module.
- BioProvDocument class
"""
from os import environ
from bioprov import read_csv
from bioprov.data import picocyano_dataset
from bioprov.src.prov import BioProvDocument
from bioprov.src.config import EnvProv
from bioprov.utils import dict_to_sha1
from pydot import Dot
project = read_csv(
picocyano_dataset, sequencefile_cols="assembly", tag="picocyanobacteria"
)
def test_EnvProv():
"""
Tests the construction of an instance of EnvProv.
:return:
"""
env = EnvProv()
for statement in (
env.env_dict == dict(environ.items()),
env.env_hash == dict_to_sha1(env.env_dict),
):
assert statement
def test_BioProvDocument():
"""
Tests the construction of an instance of BioProvDocument.
:return:
"""
# The BioProvDocument constructor with add_attributes=True
# is tested in the test_src_main.py module
prov = BioProvDocument(project)
# __repr__
assert str(prov).startswith("BioProvDocument")
# dot property
assert type(prov.dot) == Dot
prov.dot = Dot()