-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f9764c5
commit 113f626
Showing
7 changed files
with
327 additions
and
382 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
""" | ||
A Validated schema is modifed into a BaygonConfig in which: | ||
- Points a computed from `weights` and `points` fields. | ||
- Filters are converted into a Filters object. | ||
- Tests are converted into a Tests object. | ||
- Elements such as `executable`, `env`, `tty`, `timeout` are propagated to the tests. | ||
- exectuable string is converted into Executable object. | ||
""" | ||
|
||
from .schema import SchemaConfig | ||
from .filters import Filters | ||
from .matchers import MatcherFactory | ||
from .executables import Executable | ||
from .score import assign_points | ||
|
||
|
||
class BaygonConfig: | ||
def __init__(self, data): | ||
self.data = SchemaConfig(data) | ||
|
||
assign_points(self.data) | ||
|
||
def _traverse(self, data): | ||
if "executable" in data: | ||
data["executable"] = Executable(data["executable"]) | ||
if "filters" in data: | ||
data["filters"] = Filters(data["filters"]) | ||
if "tests" in data: | ||
self._traverse(data["tests"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.