Skip to content

Commit

Permalink
Adding expected constants support
Browse files Browse the repository at this point in the history
  • Loading branch information
jyejare committed Apr 19, 2024
1 parent 0c7018d commit 8d14a57
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 43 deletions.
44 changes: 44 additions & 0 deletions candore/modules/variations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
"""
A module responsible for calculating expected and skipped variations from
`conf/variations` yaml file and convert them into processable list
"""
from functools import cached_property
from candore.utils import yaml_reader, get_yaml_paths

import yaml


class Variations:
def __init__(self, settings):
self.settings = settings

@cached_property
def variations(self):
yaml_data = yaml_reader(file_path=self.settings.candore.var_file)
return yaml_data

@cached_property
def expected_variations(self):
return get_yaml_paths(yaml_data=self.variations.get("expected_variations"))

@cached_property
def skipped_variations(self):
return get_yaml_paths(yaml_data=self.variations.get("skipped_variations"))


class Constants:
def __init__(self, settings):
self.settings = settings

@cached_property
def constants(self):
yaml_data = yaml_reader(file_path=self.settings.candore.constants_file)
return yaml_data

@cached_property
def expected_constants(self):
return get_yaml_paths(yaml_data=self.constants.get("expected_constants"))

@cached_property
def skipped_constants(self):
return get_yaml_paths(yaml_data=self.constants.get("skipped_constants"))
43 changes: 0 additions & 43 deletions candore/modules/variatons.py

This file was deleted.

0 comments on commit 8d14a57

Please sign in to comment.