From 0a08af49728825163317ff82168fd1f222f7a8a8 Mon Sep 17 00:00:00 2001 From: Rob Hallam <0504004h@student.gla.ac.uk> Date: Thu, 22 Aug 2024 12:56:30 +0100 Subject: [PATCH] test: add MockSource & MockInterval to test Feature --- test/test_utils.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/test_utils.py b/test/test_utils.py index 4876366..460ad3c 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -3,6 +3,28 @@ import unittest import pipeline.utils as utils +class MockSource(): + """Mock Source object for testing Feature""" + def __init__(self, source): + self.source = source + + def __str__(self): + return self.source + + def to_json(self): + return {"source": self.source} + + def __eq__(self, other): + return self.source == other.source + +class MockInterval(): + """Mock Interval object for testing Feature""" + def __init__(self, start, end): + self.start = start + self.end = end + + def to_json(self): + return {"start": self.start, "end": self.end} class TestSource(unittest.TestCase): """Source is a container for source, path, and provider of a media file