Exemplo n.º 1
0
 def test_error_without_group_name(self):
     types.group_name = None
     with pytest.raises(exceptions.MinibossException):
         services.start_services('/tmp', [], "miniboss", 50)
     with pytest.raises(exceptions.MinibossException):
         services.stop_services('/tmp', ['test'], "miniboss", False, 50)
     with pytest.raises(exceptions.MinibossException):
         services.reload_service('/tmp', 'the-service', "miniboss", False,
                                 50)
Exemplo n.º 2
0
 def test_reload_service(self):
     services.reload_service('/tmp', 'the-service', "miniboss", False, 50)
     assert self.collection.checked_can_be_built == 'the-service'
     assert self.collection.updated_for_base_service == 'the-service'
     assert self.collection.options.network.name == 'miniboss'
     assert self.collection.options.timeout == 50
     assert self.collection.options.run_dir == '/tmp'
     assert self.collection.options.build == ['the-service']
     assert not self.collection.options.remove
Exemplo n.º 3
0
 def test_reload_service_save_and_load_context(self):
     directory = tempfile.mkdtemp()
     path = pathlib.Path(directory) / ".miniboss-context"
     with open(path, "w") as context_file:
         context_file.write(
             json.dumps({
                 "key_one": "value_one",
                 "key_two": "value_two"
             }))
     services.reload_service(directory, 'the-service', "miniboss", False,
                             50)
     assert Context['key_one'] == 'value_one'
     assert Context['key_two'] == 'value_two'
     assert path.exists()
Exemplo n.º 4
0
 def test_reload_service_network_name_none(self):
     services.reload_service('/tmp', 'the-service', None, False, 50)
     assert self.collection.options.network.name == 'miniboss-test'
Exemplo n.º 5
0
def reload(service, network_name, timeout, remove):
    services.reload_service(get_main_directory(), service, network_name, remove, timeout)