[med-svn] [Git][med-team/biomaj3-process][upstream] New upstream version 3.0.19

Olivier Sallou (@osallou) gitlab at salsa.debian.org
Mon Aug 29 13:47:48 BST 2022



Olivier Sallou pushed to branch upstream at Debian Med / biomaj3-process


Commits:
97623639 by Olivier Sallou at 2022-08-29T12:46:59+00:00
New upstream version 3.0.19
- - - - -


9 changed files:

- CHANGES.txt
- README.md
- biomaj_process/message/procmessage.proto
- biomaj_process/message/procmessage_pb2.py
- biomaj_process/process_service.py
- requirements.txt
- setup.py
- tests/biomaj_tests.py
- tests/config.yml


Changes:

=====================================
CHANGES.txt
=====================================
@@ -1,3 +1,5 @@
+3.0.19
+  Replace nose by pytest
 3.0.18:
   Normalize yaml setup with other biomaj components
 3.0.17:


=====================================
README.md
=====================================
@@ -17,9 +17,12 @@ To compile protobuf, in biomaj_process/message:
 
     flake8  biomaj_process
 
+    CONFIG=tests/config.yml python -m pytest -v tests/biomaj_tests.py
+
 # Run
 
 ## Message consumer:
+
 export BIOMAJ_CONFIG=path_to_config.yml
 python bin/biomaj_process_consumer.py
 


=====================================
biomaj_process/message/procmessage.proto
=====================================
@@ -1,3 +1,5 @@
+syntax = "proto2";
+
 package biomaj.process;
 
 message Process {


=====================================
biomaj_process/message/procmessage_pb2.py
=====================================
@@ -1,13 +1,12 @@
+# -*- coding: utf-8 -*-
 # Generated by the protocol buffer compiler.  DO NOT EDIT!
 # source: procmessage.proto
-
-import sys
-_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+"""Generated protocol buffer code."""
 from google.protobuf import descriptor as _descriptor
+from google.protobuf import descriptor_pool as _descriptor_pool
 from google.protobuf import message as _message
 from google.protobuf import reflection as _reflection
 from google.protobuf import symbol_database as _symbol_database
-from google.protobuf import descriptor_pb2
 # @@protoc_insertion_point(imports)
 
 _sym_db = _symbol_database.Default()
@@ -15,342 +14,67 @@ _sym_db = _symbol_database.Default()
 
 
 
-DESCRIPTOR = _descriptor.FileDescriptor(
-  name='procmessage.proto',
-  package='biomaj.process',
-  serialized_pb=_b('\n\x11procmessage.proto\x12\x0e\x62iomaj.process\"\xfc\x02\n\x07Process\x12\x0c\n\x04\x62\x61nk\x18\x01 \x02(\t\x12\x0f\n\x07session\x18\x02 \x02(\t\x12\x0f\n\x07log_dir\x18\x03 \x02(\t\x12\x0b\n\x03\x65xe\x18\x04 \x02(\t\x12\x0c\n\x04\x61rgs\x18\x05 \x03(\t\x12\x30\n\x08\x65nv_vars\x18\x06 \x03(\x0b\x32\x1e.biomaj.process.Process.EnvVar\x12\x1b\n\x0cshell_expand\x18\x07 \x01(\x08:\x05\x66\x61lse\x12\x0c\n\x04name\x18\x08 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\t \x01(\t\x12\x11\n\tproc_type\x18\n \x01(\t\x12\x18\n\tis_docker\x18\x0b \x01(\x08:\x05\x66\x61lse\x12.\n\x06\x64ocker\x18\x0c \x01(\x0b\x32\x1e.biomaj.process.Process.Docker\x1a%\n\x06\x45nvVar\x12\x0c\n\x04name\x18\x01 \x02(\t\x12\r\n\x05value\x18\x02 \x02(\t\x1a\x30\n\x06\x44ocker\x12\r\n\x05image\x18\x01 \x02(\t\x12\x17\n\x08use_sudo\x18\x02 \x01(\x08:\x05\x66\x61lse\"\xe7\x01\n\tOperation\x12(\n\x07process\x18\x01 \x01(\x0b\x32\x17.biomaj.process.Process\x12:\n\x04type\x18\x02 \x02(\x0e\x32#.biomaj.process.Operation.OPERATION:\x07\x45XECUTE\x12.\n\x05trace\x18\x03 \x01(\x0b\x32\x1f.biomaj.process.Operation.Trace\x1a*\n\x05Trace\x12\x10\n\x08trace_id\x18\x01 \x02(\t\x12\x0f\n\x07span_id\x18\x02 \x02(\t\"\x18\n\tOPERATION\x12\x0b\n\x07\x45XECUTE\x10\x01')
-)
-_sym_db.RegisterFileDescriptor(DESCRIPTOR)
-
-
-
-_OPERATION_OPERATION = _descriptor.EnumDescriptor(
-  name='OPERATION',
-  full_name='biomaj.process.Operation.OPERATION',
-  filename=None,
-  file=DESCRIPTOR,
-  values=[
-    _descriptor.EnumValueDescriptor(
-      name='EXECUTE', index=0, number=1,
-      options=None,
-      type=None),
-  ],
-  containing_type=None,
-  options=None,
-  serialized_start=628,
-  serialized_end=652,
-)
-_sym_db.RegisterEnumDescriptor(_OPERATION_OPERATION)
-
-
-_PROCESS_ENVVAR = _descriptor.Descriptor(
-  name='EnvVar',
-  full_name='biomaj.process.Process.EnvVar',
-  filename=None,
-  file=DESCRIPTOR,
-  containing_type=None,
-  fields=[
-    _descriptor.FieldDescriptor(
-      name='name', full_name='biomaj.process.Process.EnvVar.name', index=0,
-      number=1, type=9, cpp_type=9, label=2,
-      has_default_value=False, default_value=_b("").decode('utf-8'),
-      message_type=None, enum_type=None, containing_type=None,
-      is_extension=False, extension_scope=None,
-      options=None),
-    _descriptor.FieldDescriptor(
-      name='value', full_name='biomaj.process.Process.EnvVar.value', index=1,
-      number=2, type=9, cpp_type=9, label=2,
-      has_default_value=False, default_value=_b("").decode('utf-8'),
-      message_type=None, enum_type=None, containing_type=None,
-      is_extension=False, extension_scope=None,
-      options=None),
-  ],
-  extensions=[
-  ],
-  nested_types=[],
-  enum_types=[
-  ],
-  options=None,
-  is_extendable=False,
-  extension_ranges=[],
-  oneofs=[
-  ],
-  serialized_start=331,
-  serialized_end=368,
-)
+DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11procmessage.proto\x12\x0e\x62iomaj.process\"\xfc\x02\n\x07Process\x12\x0c\n\x04\x62\x61nk\x18\x01 \x02(\t\x12\x0f\n\x07session\x18\x02 \x02(\t\x12\x0f\n\x07log_dir\x18\x03 \x02(\t\x12\x0b\n\x03\x65xe\x18\x04 \x02(\t\x12\x0c\n\x04\x61rgs\x18\x05 \x03(\t\x12\x30\n\x08\x65nv_vars\x18\x06 \x03(\x0b\x32\x1e.biomaj.process.Process.EnvVar\x12\x1b\n\x0cshell_expand\x18\x07 \x01(\x08:\x05\x66\x61lse\x12\x0c\n\x04name\x18\x08 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\t \x01(\t\x12\x11\n\tproc_type\x18\n \x01(\t\x12\x18\n\tis_docker\x18\x0b \x01(\x08:\x05\x66\x61lse\x12.\n\x06\x64ocker\x18\x0c \x01(\x0b\x32\x1e.biomaj.process.Process.Docker\x1a%\n\x06\x45nvVar\x12\x0c\n\x04name\x18\x01 \x02(\t\x12\r\n\x05value\x18\x02 \x02(\t\x1a\x30\n\x06\x44ocker\x12\r\n\x05image\x18\x01 \x02(\t\x12\x17\n\x08use_sudo\x18\x02 \x01(\x08:\x05\x66\x61lse\"\xe7\x01\n\tOperation\x12(\n\x07process\x18\x01 \x01(\x0b\x32\x17.biomaj.process.Process\x12:\n\x04type\x18\x02 \x02(\x0e\x32#.biomaj.process.Operation.OPERATION:\x07\x45XECUTE\x12.\n\x05trace\x18\x03 \x01(\x0b\x32\x1f.biomaj.process.Operation.Trace\x1a*\n\x05Trace\x12\x10\n\x08trace_id\x18\x01 \x02(\t\x12\x0f\n\x07span_id\x18\x02 \x02(\t\"\x18\n\tOPERATION\x12\x0b\n\x07\x45XECUTE\x10\x01')
 
-_PROCESS_DOCKER = _descriptor.Descriptor(
-  name='Docker',
-  full_name='biomaj.process.Process.Docker',
-  filename=None,
-  file=DESCRIPTOR,
-  containing_type=None,
-  fields=[
-    _descriptor.FieldDescriptor(
-      name='image', full_name='biomaj.process.Process.Docker.image', index=0,
-      number=1, type=9, cpp_type=9, label=2,
-      has_default_value=False, default_value=_b("").decode('utf-8'),
-      message_type=None, enum_type=None, containing_type=None,
-      is_extension=False, extension_scope=None,
-      options=None),
-    _descriptor.FieldDescriptor(
-      name='use_sudo', full_name='biomaj.process.Process.Docker.use_sudo', index=1,
-      number=2, type=8, cpp_type=7, label=1,
-      has_default_value=True, default_value=False,
-      message_type=None, enum_type=None, containing_type=None,
-      is_extension=False, extension_scope=None,
-      options=None),
-  ],
-  extensions=[
-  ],
-  nested_types=[],
-  enum_types=[
-  ],
-  options=None,
-  is_extendable=False,
-  extension_ranges=[],
-  oneofs=[
-  ],
-  serialized_start=370,
-  serialized_end=418,
-)
 
-_PROCESS = _descriptor.Descriptor(
-  name='Process',
-  full_name='biomaj.process.Process',
-  filename=None,
-  file=DESCRIPTOR,
-  containing_type=None,
-  fields=[
-    _descriptor.FieldDescriptor(
-      name='bank', full_name='biomaj.process.Process.bank', index=0,
-      number=1, type=9, cpp_type=9, label=2,
-      has_default_value=False, default_value=_b("").decode('utf-8'),
-      message_type=None, enum_type=None, containing_type=None,
-      is_extension=False, extension_scope=None,
-      options=None),
-    _descriptor.FieldDescriptor(
-      name='session', full_name='biomaj.process.Process.session', index=1,
-      number=2, type=9, cpp_type=9, label=2,
-      has_default_value=False, default_value=_b("").decode('utf-8'),
-      message_type=None, enum_type=None, containing_type=None,
-      is_extension=False, extension_scope=None,
-      options=None),
-    _descriptor.FieldDescriptor(
-      name='log_dir', full_name='biomaj.process.Process.log_dir', index=2,
-      number=3, type=9, cpp_type=9, label=2,
-      has_default_value=False, default_value=_b("").decode('utf-8'),
-      message_type=None, enum_type=None, containing_type=None,
-      is_extension=False, extension_scope=None,
-      options=None),
-    _descriptor.FieldDescriptor(
-      name='exe', full_name='biomaj.process.Process.exe', index=3,
-      number=4, type=9, cpp_type=9, label=2,
-      has_default_value=False, default_value=_b("").decode('utf-8'),
-      message_type=None, enum_type=None, containing_type=None,
-      is_extension=False, extension_scope=None,
-      options=None),
-    _descriptor.FieldDescriptor(
-      name='args', full_name='biomaj.process.Process.args', index=4,
-      number=5, type=9, cpp_type=9, label=3,
-      has_default_value=False, default_value=[],
-      message_type=None, enum_type=None, containing_type=None,
-      is_extension=False, extension_scope=None,
-      options=None),
-    _descriptor.FieldDescriptor(
-      name='env_vars', full_name='biomaj.process.Process.env_vars', index=5,
-      number=6, type=11, cpp_type=10, label=3,
-      has_default_value=False, default_value=[],
-      message_type=None, enum_type=None, containing_type=None,
-      is_extension=False, extension_scope=None,
-      options=None),
-    _descriptor.FieldDescriptor(
-      name='shell_expand', full_name='biomaj.process.Process.shell_expand', index=6,
-      number=7, type=8, cpp_type=7, label=1,
-      has_default_value=True, default_value=False,
-      message_type=None, enum_type=None, containing_type=None,
-      is_extension=False, extension_scope=None,
-      options=None),
-    _descriptor.FieldDescriptor(
-      name='name', full_name='biomaj.process.Process.name', index=7,
-      number=8, type=9, cpp_type=9, label=1,
-      has_default_value=False, default_value=_b("").decode('utf-8'),
-      message_type=None, enum_type=None, containing_type=None,
-      is_extension=False, extension_scope=None,
-      options=None),
-    _descriptor.FieldDescriptor(
-      name='description', full_name='biomaj.process.Process.description', index=8,
-      number=9, type=9, cpp_type=9, label=1,
-      has_default_value=False, default_value=_b("").decode('utf-8'),
-      message_type=None, enum_type=None, containing_type=None,
-      is_extension=False, extension_scope=None,
-      options=None),
-    _descriptor.FieldDescriptor(
-      name='proc_type', full_name='biomaj.process.Process.proc_type', index=9,
-      number=10, type=9, cpp_type=9, label=1,
-      has_default_value=False, default_value=_b("").decode('utf-8'),
-      message_type=None, enum_type=None, containing_type=None,
-      is_extension=False, extension_scope=None,
-      options=None),
-    _descriptor.FieldDescriptor(
-      name='is_docker', full_name='biomaj.process.Process.is_docker', index=10,
-      number=11, type=8, cpp_type=7, label=1,
-      has_default_value=True, default_value=False,
-      message_type=None, enum_type=None, containing_type=None,
-      is_extension=False, extension_scope=None,
-      options=None),
-    _descriptor.FieldDescriptor(
-      name='docker', full_name='biomaj.process.Process.docker', index=11,
-      number=12, type=11, cpp_type=10, label=1,
-      has_default_value=False, default_value=None,
-      message_type=None, enum_type=None, containing_type=None,
-      is_extension=False, extension_scope=None,
-      options=None),
-  ],
-  extensions=[
-  ],
-  nested_types=[_PROCESS_ENVVAR, _PROCESS_DOCKER, ],
-  enum_types=[
-  ],
-  options=None,
-  is_extendable=False,
-  extension_ranges=[],
-  oneofs=[
-  ],
-  serialized_start=38,
-  serialized_end=418,
-)
 
+_PROCESS = DESCRIPTOR.message_types_by_name['Process']
+_PROCESS_ENVVAR = _PROCESS.nested_types_by_name['EnvVar']
+_PROCESS_DOCKER = _PROCESS.nested_types_by_name['Docker']
+_OPERATION = DESCRIPTOR.message_types_by_name['Operation']
+_OPERATION_TRACE = _OPERATION.nested_types_by_name['Trace']
+_OPERATION_OPERATION = _OPERATION.enum_types_by_name['OPERATION']
+Process = _reflection.GeneratedProtocolMessageType('Process', (_message.Message,), {
 
-_OPERATION_TRACE = _descriptor.Descriptor(
-  name='Trace',
-  full_name='biomaj.process.Operation.Trace',
-  filename=None,
-  file=DESCRIPTOR,
-  containing_type=None,
-  fields=[
-    _descriptor.FieldDescriptor(
-      name='trace_id', full_name='biomaj.process.Operation.Trace.trace_id', index=0,
-      number=1, type=9, cpp_type=9, label=2,
-      has_default_value=False, default_value=_b("").decode('utf-8'),
-      message_type=None, enum_type=None, containing_type=None,
-      is_extension=False, extension_scope=None,
-      options=None),
-    _descriptor.FieldDescriptor(
-      name='span_id', full_name='biomaj.process.Operation.Trace.span_id', index=1,
-      number=2, type=9, cpp_type=9, label=2,
-      has_default_value=False, default_value=_b("").decode('utf-8'),
-      message_type=None, enum_type=None, containing_type=None,
-      is_extension=False, extension_scope=None,
-      options=None),
-  ],
-  extensions=[
-  ],
-  nested_types=[],
-  enum_types=[
-  ],
-  options=None,
-  is_extendable=False,
-  extension_ranges=[],
-  oneofs=[
-  ],
-  serialized_start=584,
-  serialized_end=626,
-)
-
-_OPERATION = _descriptor.Descriptor(
-  name='Operation',
-  full_name='biomaj.process.Operation',
-  filename=None,
-  file=DESCRIPTOR,
-  containing_type=None,
-  fields=[
-    _descriptor.FieldDescriptor(
-      name='process', full_name='biomaj.process.Operation.process', index=0,
-      number=1, type=11, cpp_type=10, label=1,
-      has_default_value=False, default_value=None,
-      message_type=None, enum_type=None, containing_type=None,
-      is_extension=False, extension_scope=None,
-      options=None),
-    _descriptor.FieldDescriptor(
-      name='type', full_name='biomaj.process.Operation.type', index=1,
-      number=2, type=14, cpp_type=8, label=2,
-      has_default_value=True, default_value=1,
-      message_type=None, enum_type=None, containing_type=None,
-      is_extension=False, extension_scope=None,
-      options=None),
-    _descriptor.FieldDescriptor(
-      name='trace', full_name='biomaj.process.Operation.trace', index=2,
-      number=3, type=11, cpp_type=10, label=1,
-      has_default_value=False, default_value=None,
-      message_type=None, enum_type=None, containing_type=None,
-      is_extension=False, extension_scope=None,
-      options=None),
-  ],
-  extensions=[
-  ],
-  nested_types=[_OPERATION_TRACE, ],
-  enum_types=[
-    _OPERATION_OPERATION,
-  ],
-  options=None,
-  is_extendable=False,
-  extension_ranges=[],
-  oneofs=[
-  ],
-  serialized_start=421,
-  serialized_end=652,
-)
-
-_PROCESS_ENVVAR.containing_type = _PROCESS
-_PROCESS_DOCKER.containing_type = _PROCESS
-_PROCESS.fields_by_name['env_vars'].message_type = _PROCESS_ENVVAR
-_PROCESS.fields_by_name['docker'].message_type = _PROCESS_DOCKER
-_OPERATION_TRACE.containing_type = _OPERATION
-_OPERATION.fields_by_name['process'].message_type = _PROCESS
-_OPERATION.fields_by_name['type'].enum_type = _OPERATION_OPERATION
-_OPERATION.fields_by_name['trace'].message_type = _OPERATION_TRACE
-_OPERATION_OPERATION.containing_type = _OPERATION
-DESCRIPTOR.message_types_by_name['Process'] = _PROCESS
-DESCRIPTOR.message_types_by_name['Operation'] = _OPERATION
-
-Process = _reflection.GeneratedProtocolMessageType('Process', (_message.Message,), dict(
-
-  EnvVar = _reflection.GeneratedProtocolMessageType('EnvVar', (_message.Message,), dict(
-    DESCRIPTOR = _PROCESS_ENVVAR,
-    __module__ = 'procmessage_pb2'
+  'EnvVar' : _reflection.GeneratedProtocolMessageType('EnvVar', (_message.Message,), {
+    'DESCRIPTOR' : _PROCESS_ENVVAR,
+    '__module__' : 'procmessage_pb2'
     # @@protoc_insertion_point(class_scope:biomaj.process.Process.EnvVar)
-    ))
+    })
   ,
 
-  Docker = _reflection.GeneratedProtocolMessageType('Docker', (_message.Message,), dict(
-    DESCRIPTOR = _PROCESS_DOCKER,
-    __module__ = 'procmessage_pb2'
+  'Docker' : _reflection.GeneratedProtocolMessageType('Docker', (_message.Message,), {
+    'DESCRIPTOR' : _PROCESS_DOCKER,
+    '__module__' : 'procmessage_pb2'
     # @@protoc_insertion_point(class_scope:biomaj.process.Process.Docker)
-    ))
+    })
   ,
-  DESCRIPTOR = _PROCESS,
-  __module__ = 'procmessage_pb2'
+  'DESCRIPTOR' : _PROCESS,
+  '__module__' : 'procmessage_pb2'
   # @@protoc_insertion_point(class_scope:biomaj.process.Process)
-  ))
+  })
 _sym_db.RegisterMessage(Process)
 _sym_db.RegisterMessage(Process.EnvVar)
 _sym_db.RegisterMessage(Process.Docker)
 
-Operation = _reflection.GeneratedProtocolMessageType('Operation', (_message.Message,), dict(
+Operation = _reflection.GeneratedProtocolMessageType('Operation', (_message.Message,), {
 
-  Trace = _reflection.GeneratedProtocolMessageType('Trace', (_message.Message,), dict(
-    DESCRIPTOR = _OPERATION_TRACE,
-    __module__ = 'procmessage_pb2'
+  'Trace' : _reflection.GeneratedProtocolMessageType('Trace', (_message.Message,), {
+    'DESCRIPTOR' : _OPERATION_TRACE,
+    '__module__' : 'procmessage_pb2'
     # @@protoc_insertion_point(class_scope:biomaj.process.Operation.Trace)
-    ))
+    })
   ,
-  DESCRIPTOR = _OPERATION,
-  __module__ = 'procmessage_pb2'
+  'DESCRIPTOR' : _OPERATION,
+  '__module__' : 'procmessage_pb2'
   # @@protoc_insertion_point(class_scope:biomaj.process.Operation)
-  ))
+  })
 _sym_db.RegisterMessage(Operation)
 _sym_db.RegisterMessage(Operation.Trace)
 
-
+if _descriptor._USE_C_DESCRIPTORS == False:
+
+  DESCRIPTOR._options = None
+  _PROCESS._serialized_start=38
+  _PROCESS._serialized_end=418
+  _PROCESS_ENVVAR._serialized_start=331
+  _PROCESS_ENVVAR._serialized_end=368
+  _PROCESS_DOCKER._serialized_start=370
+  _PROCESS_DOCKER._serialized_end=418
+  _OPERATION._serialized_start=421
+  _OPERATION._serialized_end=652
+  _OPERATION_TRACE._serialized_start=584
+  _OPERATION_TRACE._serialized_end=626
+  _OPERATION_OPERATION._serialized_start=628
+  _OPERATION_OPERATION._serialized_end=652
 # @@protoc_insertion_point(module_scope)


=====================================
biomaj_process/process_service.py
=====================================
@@ -61,6 +61,23 @@ def consul_declare(config):
         return False
 
 
+class MemoryStore(object):
+
+    def __init__(self) -> None:
+        self.data = {}
+
+    def delete(self, key):
+        if key in self.data:
+            del self.data[key]
+
+    def set(self, key, value):
+        self.data[key] = value
+
+    def get(self, key):
+        if key not in self.data:
+            return None
+        return self.data[key]
+
 class ProcessService(object):
 
     channel = None
@@ -90,11 +107,13 @@ class ProcessService(object):
 
         if not self.redis_client:
             self.logger.debug('Init redis connection')
-            self.redis_client = redis.StrictRedis(host=self.config['redis']['host'],
+            if self.config['redis']['host']:
+                self.redis_client = redis.StrictRedis(host=self.config['redis']['host'],
                                                   port=self.config['redis']['port'],
                                                   db=self.config['redis']['db'],
                                                   decode_responses=True)
-
+            else:
+                self.redis_client = MemoryStore()
         if rabbitmq and not self.channel:
             connection = None
             rabbitmq_port = self.config['rabbitmq']['port']


=====================================
requirements.txt
=====================================
@@ -1,5 +1,5 @@
 mock
-nose
+pytest
 pika==0.13.0
 redis
 PyYAML


=====================================
setup.py
=====================================
@@ -21,7 +21,7 @@ config = {
     'url': 'http://biomaj.genouest.org',
     'download_url': 'http://biomaj.genouest.org',
     'author_email': 'olivier.sallou at irisa.fr',
-    'version': '3.0.18',
+    'version': '3.0.19',
      'classifiers': [
         # How mature is this project? Common values are
         #   3 - Alpha
@@ -53,8 +53,7 @@ config = {
                          'protobuf',
                          'requests'
                         ],
-    'tests_require': ['nose', 'mock'],
-    'test_suite': 'nose.collector',
+    'tests_require': ['pytest', 'mock'],
     'packages': find_packages(),
     'include_package_data': True,
     'scripts': ['bin/biomaj_process_consumer.py'],


=====================================
tests/biomaj_tests.py
=====================================
@@ -1,6 +1,3 @@
-from nose.tools import *
-from nose.plugins.attrib import attr
-
 import json
 import shutil
 import os
@@ -15,18 +12,18 @@ from mock import patch
 from biomaj_process.message import procmessage_pb2
 from biomaj_process.process_service import ProcessService
 
-import unittest
+import pytest
 
 
-class TestBiomajProcess(unittest.TestCase):
+class TestBiomajProcess():
 
-  def setUp(self):
+  def setup_method(self, m):
     self.curdir = os.path.dirname(os.path.realpath(__file__))
     self.pserv = ProcessService(os.path.join(self.curdir, 'config.yml'),rabbitmq=False)
     self.session = self.pserv._create_session('test')
     self.test_dir = tempfile.mkdtemp('biomaj')
 
-  def tearDown(self):
+  def teardown_method(self, m):
     self.pserv.clean()
     shutil.rmtree(self.test_dir)
 
@@ -47,4 +44,4 @@ class TestBiomajProcess(unittest.TestCase):
     msg.shell_expand = False
     print(msg)
     proc = self.pserv.execute(msg)
-    self.assertTrue(proc['exitcode'] == 0)
+    assert (proc['exitcode'] == 0)


=====================================
tests/config.yml
=====================================
@@ -1,7 +1,7 @@
 
 
 redis:
-    host: '127.0.0.1'
+    host: ''
     #host: '131.254.17.40'
     port: 6379
     db: 0



View it on GitLab: https://salsa.debian.org/med-team/biomaj3-process/-/commit/976236396f7bf0a6942a3c5f3815fb2a25fd076d

-- 
View it on GitLab: https://salsa.debian.org/med-team/biomaj3-process/-/commit/976236396f7bf0a6942a3c5f3815fb2a25fd076d
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20220829/9f3d5be7/attachment-0001.htm>


More information about the debian-med-commit mailing list