-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtest_flashweave.py
More file actions
45 lines (29 loc) · 1.21 KB
/
test_flashweave.py
File metadata and controls
45 lines (29 loc) · 1.21 KB
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
import os
import copy
import yaml
import unittest
from microbetag.config import Config
from microbetag.tools import run_flashweave
root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
test_data = os.path.join(root_dir, "test_data", "test_flashweave")
config_file = os.path.join(test_data, "config_test_fw.yml")
# Initially the configuration mentions a metadata file
with open(config_file, "r") as yaml_file:
config_meta = Config(yaml.safe_load(yaml_file), config_file)
config_meta.network = os.path.join(config_meta.output_dir, "network_metadata.edgelist")
# We make a second config and we shut down the metadata file part
with open(config_file, "r") as yaml_file:
config = Config(yaml.safe_load(yaml_file), config_file)
config.metadata = "false"
config.metadata_file = None
class TestRunFlashweave(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.config = config
cls.config_meta = config_meta
def test_run_flashweave(self):
run_flashweave(config=self.config)
def test_run_flashweave_metadata(self):
run_flashweave(config=self.config_meta)
if __name__ == "__main__":
unittest.main()