forked from fga-eps-mds/MeasureSoftGram-Core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request fga-eps-mds#16 from fga-eps-mds/fix/fixing_imports
fix: correcting imports
- Loading branch information
Showing
7 changed files
with
140 additions
and
7 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
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
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
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,80 @@ | ||
import pytest | ||
from marshmallow.exceptions import ValidationError | ||
|
||
from core.schemas import ( | ||
NonComplexFileDensitySchema, | ||
CommentedFileDensitySchema, | ||
DuplicationAbsenceSchema, | ||
PassedTestsSchema, | ||
TestBuildsSchema, | ||
TestCoverageSchema, | ||
CIFeedbackTimeSchema, | ||
TeamThroughputSchema, | ||
) | ||
|
||
from tests.utils.schemas_data import ( | ||
NON_COMPLEX_FILES_DENSITY_METRICS_DATA, | ||
COMMENTED_FILE_DENSITY_METRICS_DATA, | ||
DUPLICATION_ABSENCE_METRICS_DATA, | ||
PASSED_TESTS_METRICS_DATA, | ||
TEST_BUILDS_METRICS_DATA, | ||
TEST_COVERAGE_METRICS_DATA, | ||
CI_FEEDBACK_TIME_METRICS_DATA, | ||
TEAM_THROUGHPUT_METRICS_DATA, | ||
) | ||
|
||
|
||
def test_non_complex_file_density_schema_validation(): | ||
try: | ||
NonComplexFileDensitySchema().load(NON_COMPLEX_FILES_DENSITY_METRICS_DATA) | ||
except ValidationError as e: | ||
pytest.fail(f"Unexpected error: {e}") | ||
|
||
|
||
def test_commented_file_density_schema_validation(): | ||
try: | ||
CommentedFileDensitySchema().load(COMMENTED_FILE_DENSITY_METRICS_DATA) | ||
except ValidationError as e: | ||
pytest.fail(f"Unexpected error: {e}") | ||
|
||
|
||
def test_duplication_absence_schema_validation(): | ||
try: | ||
DuplicationAbsenceSchema().load(DUPLICATION_ABSENCE_METRICS_DATA) | ||
except ValidationError as e: | ||
pytest.fail(f"Unexpected error: {e}") | ||
|
||
|
||
def test_passed_tests_schema_validation(): | ||
try: | ||
PassedTestsSchema().load(PASSED_TESTS_METRICS_DATA) | ||
except ValidationError as e: | ||
pytest.fail(f"Unexpected error: {e}") | ||
|
||
|
||
def test_test_builds_schema_validation(): | ||
try: | ||
TestBuildsSchema().load(TEST_BUILDS_METRICS_DATA) | ||
except ValidationError as e: | ||
pytest.fail(f"Unexpected error: {e}") | ||
|
||
|
||
def test_test_coverage_schema_validation(): | ||
try: | ||
TestCoverageSchema().load(TEST_COVERAGE_METRICS_DATA) | ||
except ValidationError as e: | ||
pytest.fail(f"Unexpected error: {e}") | ||
|
||
|
||
def test_ci_feedback_time_schema_validation(): | ||
try: | ||
CIFeedbackTimeSchema().load(CI_FEEDBACK_TIME_METRICS_DATA) | ||
except ValidationError as e: | ||
pytest.fail(f"Unexpected error: {e}") | ||
|
||
|
||
def test_team_throughput_schema_validation(): | ||
try: | ||
TeamThroughputSchema().load(TEAM_THROUGHPUT_METRICS_DATA) | ||
except ValidationError as e: | ||
pytest.fail(f"Unexpected error: {e}") |
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
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
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,53 @@ | ||
NON_COMPLEX_FILES_DENSITY_METRICS_DATA = { | ||
"metrics": [ | ||
{"key": "complexity", "value": [0.7]}, | ||
{"key": "functions", "value": [0.5]}, | ||
] | ||
} | ||
|
||
COMMENTED_FILE_DENSITY_METRICS_DATA = { | ||
"metrics": [ | ||
{"key": "comment_lines_density", "value": [0.5]}, | ||
] | ||
} | ||
|
||
DUPLICATION_ABSENCE_METRICS_DATA = { | ||
"metrics": [ | ||
{"key": "duplicated_lines_density", "value": [0.1]}, | ||
] | ||
} | ||
|
||
PASSED_TESTS_METRICS_DATA = { | ||
"metrics": [ | ||
{"key": "tests", "value": [10.0]}, | ||
{"key": "test_failures", "value": [1.0]}, | ||
{"key": "test_errors", "value": [0.0]}, | ||
] | ||
} | ||
|
||
TEST_BUILDS_METRICS_DATA = { | ||
"metrics": [ | ||
{"key": "test_execution_time", "value": [8.0]}, | ||
{"key": "tests", "value": [10.0]}, | ||
] | ||
} | ||
|
||
TEST_COVERAGE_METRICS_DATA = { | ||
"metrics": [ | ||
{"key": "coverage", "value": [0.75]}, | ||
] | ||
} | ||
|
||
CI_FEEDBACK_TIME_METRICS_DATA = { | ||
"metrics": [ | ||
{"key": "sum_ci_feedback_times", "value": [15.0]}, | ||
{"key": "total_builds", "value": [20.0]}, | ||
] | ||
} | ||
|
||
TEAM_THROUGHPUT_METRICS_DATA = { | ||
"metrics": [ | ||
{"key": "resolved_issues", "value": [15.0]}, | ||
{"key": "total_issues", "value": [20.0]}, | ||
] | ||
} |