Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

36 Zeilen
897 B

  1. """Mocks for testing"""
  2. class MockInterval():
  3. """Mock Interval object for testing Feature"""
  4. def __init__(self, start, end):
  5. self.start = start
  6. self.end = end
  7. self.duration = end - start
  8. def to_json(self):
  9. return {"start": self.start, "end": self.end}
  10. class MockFeature():
  11. """Mock feature object for testing"""
  12. def __init__(self, interval, source=None):
  13. self.interval = interval
  14. self.source = source
  15. def to_json(self):
  16. return {"interval": self.interval}
  17. class MockSource():
  18. """Mock Source object for testing Feature"""
  19. def __init__(self, source=None, path=None):
  20. self.source = source
  21. self.path = path
  22. def __str__(self):
  23. return self.source
  24. def to_json(self):
  25. return {"source": self.source}
  26. def __eq__(self, other):
  27. return self.source == other.source