Преглед изворни кода

test: add MockSource & MockInterval to test Feature

main
Rob Hallam пре 2 месеци
родитељ
комит
0a08af4972
1 измењених фајлова са 22 додато и 0 уклоњено
  1. +22
    -0
      test/test_utils.py

+ 22
- 0
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


Loading…
Откажи
Сачувај