Skip to content

Commit

Permalink
Added test cases
Browse files Browse the repository at this point in the history
Signed-off-by: Andriy Redko <[email protected]>
  • Loading branch information
reta committed Oct 20, 2021
1 parent 9bedf46 commit 13de88b
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/tests_manifests/test_input_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,35 @@ def test_1_1(self):
self.assertIsNone(alerting_component.checks[0].args)
self.assertEqual(alerting_component.checks[1].args, "alerting")

def test_1_2(self):
path = os.path.join(self.manifests_path, "1.2.0/opensearch-1.2.0.yml")
manifest = InputManifest.from_path(path)
self.assertEqual(manifest.version, "1.0")
self.assertEqual(manifest.build.name, "OpenSearch")
self.assertEqual(manifest.build.version, "1.2.0")
self.assertEqual(manifest.ci.image.name, "opensearchstaging/ci-runner:centos7-x64-arm64-jdkmulti-node10.24.1-cypress6.9.1-20211019")
self.assertEqual(manifest.ci.image.args, "-e JAVA_HOME=/usr/lib/jvm/adoptopenjdk-14-hotspot")
self.assertEqual(len(manifest.components), 5)
# opensearch component
opensearch_component = manifest.components[0]
self.assertEqual(opensearch_component.name, "OpenSearch")
self.assertEqual(
opensearch_component.repository,
"https://github.com/opensearch-project/OpenSearch.git",
)
self.assertEqual(opensearch_component.ref, "1.1")
# components
for component in manifest.components:
self.assertIsInstance(component.ref, str)
# alerting component checks
alerting_component = next(c for c in manifest.components if c.name == "alerting")
self.assertIsNotNone(alerting_component)
self.assertEqual(len(alerting_component.checks), 2)
for check in alerting_component.checks:
self.assertIsInstance(check, InputManifest.Check)
self.assertIsNone(alerting_component.checks[0].args)
self.assertEqual(alerting_component.checks[1].args, "alerting")

def test_to_dict(self):
path = os.path.join(self.manifests_path, "1.1.0/opensearch-1.1.0.yml")
manifest = InputManifest.from_path(path)
Expand Down

0 comments on commit 13de88b

Please sign in to comment.