From f15fac33627952ccf5d85a8c363b6d829c03b90d Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 11 Apr 2022 15:24:31 +0300 Subject: Add tests for headers * Add tests to check for validity of the headers * Add stubs for the tests --- quality_control/errors.py | 11 ++++++++--- quality_control/headers.py | 7 +++++++ 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 quality_control/headers.py (limited to 'quality_control') diff --git a/quality_control/errors.py b/quality_control/errors.py index 961ce8e..a77039b 100644 --- a/quality_control/errors.py +++ b/quality_control/errors.py @@ -3,6 +3,11 @@ class InvalidValue(Exception): """Raised when a function encounters an invalid value""" - def __init__(self, args): - Exception.__init__(self, args) - + def __init__(self, *args): + Exception.__init__(self, *args) + +class InvalidHeaderValue(Exception): + """Raised when a header contains values not in the reference file.""" + + def __init__(self, *args): + Exception.__init__(self, *args) diff --git a/quality_control/headers.py b/quality_control/headers.py new file mode 100644 index 0000000..b8ff160 --- /dev/null +++ b/quality_control/headers.py @@ -0,0 +1,7 @@ +"""Validate the headers""" + +from quality_control.errors import InvalidHeaderValue + +def valid_header(strains, headers): + "Return the valid headers with reference to strains or throw an error" + return None -- cgit v1.2.3