Skip to content

Commit

Permalink
Created very small unit test for the resolve_template method in the C…
Browse files Browse the repository at this point in the history
…onductor class
  • Loading branch information
rsashti committed Feb 8, 2024
1 parent fa9974e commit f50854a
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions test/test_conductor.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
from pros.conductor import Conductor
from pros.conductor.templates import BaseTemplate
from pros.conductor.templates import LocalTemplate
import unittest


class TestConductor(unittest.TestCase):
### using __init__() with the unittest module causes errors, setUp is recognized by the module and should be used instead.
# it will run again before every unit test
# setUp will run before every unit test
def setUp(self):
self._conductor = Conductor()
print(self._conductor.depots["pros-mainline"].location)
# super().__init__(methodName)

def test_resolve_template(self, name: str, version: str):
self._okapilib_template = BaseTemplate(name="okapilib")
self._resolved_template = self._conductor.resolve_template(identifier="okapilib")

def test_resolve_template(self):
okapilib_template = LocalTemplate(name="okapilib", version="5.0.0")
resolved_template = self._conductor.resolve_template(identifier="okapilib")
self.assertTrue(resolved_template == okapilib_template)


if __name__ == "__main__":
Expand Down

0 comments on commit f50854a

Please sign in to comment.