Skip to content

Commit

Permalink
Merge pull request #27 from neutrons/ewm2814_consumer
Browse files Browse the repository at this point in the history
Remove empty test and add badge
  • Loading branch information
backmari authored Dec 1, 2023
2 parents ca68e29 + b8e2b3e commit 36bf63d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 30 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ New version of the post-processing agent for automated reduction and cataloging.
For the old version of the post-processing agent, see https://github.com/mantidproject/autoreduce


[![codecov](https://codecov.io/github/neutrons/post_processing_agent/graph/badge.svg?token=OYoTSnbmEL)](https://codecov.io/github/neutrons/post_processing_agent)

Configuration
-------------
A configuration must be placed in `/etc/post_process_consumer.conf`.
Expand Down
21 changes: 21 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,24 @@ def docker_exec_and_cat(filename):
shell=True,
)
return filecontents


def getDevConfiguration(dev_output_dir=""):
"""
Create a Configuration object with a now developer directory
@param dev_output_dir: Location of the output directory
"""
from postprocessing.Configuration import Configuration

srcdir = os.path.dirname(os.path.realpath(__file__)) # directory this file is in
# go up 1 level to get out of tests directory
srcdir = os.path.split(srcdir)[0]

# load the developer configuration file
config = Configuration(
os.path.join(srcdir, "configuration/post_process_consumer.conf.development")
)
if dev_output_dir:
config.dev_output_dir = dev_output_dir
config.dev_instrument_shared = os.path.join(dev_output_dir, "shared")
return config
10 changes: 0 additions & 10 deletions tests/unit/postprocessing/test_Consumer.py

This file was deleted.

21 changes: 1 addition & 20 deletions tests/unit/postprocessing/test_PostProcessAdmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,13 @@

import shutil

from postprocessing.Configuration import Configuration
from postprocessing.PostProcessAdmin import PostProcessAdmin

# third-party imports
import os
import pytest
import tempfile


def getDevConfiguration(dev_output_dir=""):
"""
Create a Configuration object with a now developer directory
@param dev_output_dir: Location of the output directory
"""
srcdir = os.path.dirname(os.path.realpath(__file__)) # directory this file is in
# go up 3 levels
for i in range(3):
srcdir = os.path.split(srcdir)[0]
# load the developer configuration file
config = Configuration(
os.path.join(srcdir, "configuration/post_process_consumer.conf.development")
)
if dev_output_dir:
config.dev_output_dir = dev_output_dir
config.dev_instrument_shared = os.path.join(dev_output_dir, "shared")
return config
from tests.conftest import getDevConfiguration


def createEmptyFile(filename):
Expand Down

0 comments on commit 36bf63d

Please sign in to comment.