ray simulations seem to work
nodes (except head node) can deconnect and reconnect to/from the cluster and work is rebalanced properly. if a node dies while simulating, the leftover work is picked up at the end and everything is merged normall. Tests of the actual validity of the mergd data have not been made yet
This commit is contained in:
30
testing/test_utils.py
Normal file
30
testing/test_utils.py
Normal file
@@ -0,0 +1,30 @@
|
||||
import unittest
|
||||
from scgenerator import utils, initialize
|
||||
import toml
|
||||
|
||||
|
||||
def load_conf(name):
|
||||
with open("testing/configs/" + name + ".toml") as file:
|
||||
conf = toml.load(file)
|
||||
return conf
|
||||
|
||||
|
||||
def conf_maker(folder):
|
||||
def conf(name):
|
||||
return initialize.validate(load_conf(folder + "/" + name))
|
||||
|
||||
return conf
|
||||
|
||||
|
||||
class TestUtilsMethods(unittest.TestCase):
|
||||
def test_count_variations(self):
|
||||
conf = conf_maker("count_variations")
|
||||
|
||||
self.assertEqual((1, 0), utils.count_variations(conf("1sim_0vary")))
|
||||
self.assertEqual((1, 1), utils.count_variations(conf("1sim_1vary")))
|
||||
self.assertEqual((2, 1), utils.count_variations(conf("2sim_1vary")))
|
||||
self.assertEqual((2, 0), utils.count_variations(conf("2sim_0vary")))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user