Skip to content

Commit

Permalink
Merge pull request #353 from 0hsn/feat/rename-validate-spec-version-s…
Browse files Browse the repository at this point in the history
…tring

Refactor: Rename validate specificaion docs version string
  • Loading branch information
0hsn authored Jan 5, 2025
2 parents 2cac272 + 55f91cf commit 1e747c5
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion chk/infrastructure/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"0.7.2",
"0.8.0",
],
"validation": [
"validate": [
"0.7.2",
"0.8.0",
],
Expand Down
2 changes: 1 addition & 1 deletion chk/modules/validate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
from chk.modules.validate.entities import ValidationTask
from chk.modules.validate.services import ValidatePresenter

VERSION_SCOPE = ["validation"]
VERSION_SCOPE = ["validate"]


class ValidationConfigNode(enum.StrEnum):
Expand Down
38 changes: 19 additions & 19 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/modules/validate/assertion_services_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
def setup_assertion_entry_list_pass_assert():
ctx = FileContext(
document={
"version": "default:validation:0.7.2",
"version": "default:validate:0.7.2",
"asserts": [
{
"type": "Equal",
Expand Down Expand Up @@ -64,7 +64,7 @@ def setup_assertion_entry_list_pass_assert():
def setup_assertion_entry_list_many_items_pass_assert():
ctx = FileContext(
document={
"version": "default:validation:0.7.2",
"version": "default:validate:0.7.2",
"asserts": [
{
"type": "Equal",
Expand Down
18 changes: 9 additions & 9 deletions tests/modules/validate/validate_entity_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class TestValidationDocument:
def test_from_file_context_pass_when_no_data():
ctx = FileContext(
document={
"version": "default:validation:0.7.2",
"version": "default:validate:0.7.2",
"asserts": [
{
"type": "Equal",
Expand All @@ -47,7 +47,7 @@ def test_from_file_context_pass_when_no_data():
def test_from_file_context_pass_when_data():
ctx = FileContext(
document={
"version": "default:validation:0.7.2",
"version": "default:validate:0.7.2",
"asserts": [
{
"type": "Equal",
Expand Down Expand Up @@ -80,7 +80,7 @@ def test_from_file_context_pass_when_data():
def test_from_file_context_fail_when_no_asserts():
ctx = FileContext(
document={
"version": "default:validation:0.7.2",
"version": "default:validate:0.7.2",
"data": {
"name": "Sadaqat",
"roll": 39,
Expand All @@ -98,7 +98,7 @@ def test_from_file_context_fail_when_no_asserts():
def test_as_dict_pass():
ctx = FileContext(
document={
"version": "default:validation:0.7.2",
"version": "default:validate:0.7.2",
"asserts": [
{
"type": "Equal",
Expand Down Expand Up @@ -133,7 +133,7 @@ def test_build_schema_pass():
def test_set_data_template_pass_when_set_from_exec_ctx(self):
ctx = FileContext(
document={
"version": "default:validation:0.7.2",
"version": "default:validate:0.7.2",
"asserts": [
{
"type": "Equal",
Expand Down Expand Up @@ -162,7 +162,7 @@ def test_set_data_template_pass_when_set_from_exec_ctx(self):
def test_set_data_template_pass_when_set_from_doc(self):
ctx = FileContext(
document={
"version": "default:validation:0.7.2",
"version": "default:validate:0.7.2",
"asserts": [
{
"type": "Equal",
Expand Down Expand Up @@ -191,7 +191,7 @@ def test_set_data_template_pass_when_set_from_doc(self):
def test_set_data_template_pass_exec_ctx_prioritise(self):
ctx = FileContext(
document={
"version": "default:validation:0.7.2",
"version": "default:validate:0.7.2",
"asserts": [
{
"type": "Equal",
Expand Down Expand Up @@ -226,7 +226,7 @@ def test_set_data_template_pass_exec_ctx_prioritise(self):
def test_process_data_template_pass():
ctx = FileContext(
document={
"version": "default:validation:0.7.2",
"version": "default:validate:0.7.2",
"asserts": [
{
"type": "Equal",
Expand Down Expand Up @@ -265,7 +265,7 @@ def test_process_data_template_pass():
def test_make_assertion_entry_list_pass():
ctx = FileContext(
document={
"version": "default:validation:0.7.2",
"version": "default:validate:0.7.2",
"asserts": [
{
"type": "Equal",
Expand Down
4 changes: 2 additions & 2 deletions tests/modules/validate/validate_module_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class TestValidateCall:
def test_fail() -> None:
file_ctx = FileContext(
document={
# "version": "default:validation:0.7.2",
# "version": "default:validate:0.7.2",
"asserts": [
{
"type": "Equal",
Expand Down Expand Up @@ -42,7 +42,7 @@ def test_fail() -> None:
def test_fail_for_wrong_key() -> None:
file_ctx = FileContext(
document={
"version": "default:validation:0.7.2",
"version": "default:validate:0.7.2",
"asserts": [
{
"type": "Equals",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: default:validation:0.7.2
version: default:validate:0.7.2

asserts:
- { type: Equal, actual: <% _data.code %>, expected: 200, msg_pass: 'Response was successful with code `{type_actual}({value_actual})`' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: default:validation:0.7.2
version: default:validate:0.7.2

asserts:
- { type: Equal, actual: <% _data.roll %>, expected: 39 }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: default:validation:0.7.2
version: default:validate:0.7.2

variables:
response:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: default:validation:0.7.2
version: default:validate:0.7.2

variables:
vdata: ~
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: default:validation:0.7.2
version: default:validate:0.7.2

asserts:
- { type: List, actual: <% _data.body %> }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: default:validation:0.7.2
version: default:validate:0.7.2

asserts:
- { type: MapHasKeys, actual: <% _data %>, expected: ["id", "username", "name", "email", "provider"] }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: default:validation:0.7.2
version: default:validate:0.7.2

variables:
userName: ~
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: default:validation:0.7.2
version: default:validate:0.7.2

asserts:
- { type: MapHasKeys, actual: <% _data %>, expected: ["userId", "currentStreak", "longestStreak", "lastStreaksDay"] }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: default:validation:0.7.2
version: default:validate:0.7.2

variables:
userName: ~
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: default:validation:0.7.2
version: default:validate:0.7.2

asserts:
- { type: Equal, actual: <% _data.code %>, expected: 200, msg_pass: 'Response was successful with code `{type_actual}({value_actual})`', cast_actual_to: int }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: default:validation:0.7.2
version: default:validate:0.7.2

asserts:
- { type: Equal, actual: <% _data.code %>, expected: 200, msg_pass: 'Response was successful with code `{type_actual}({value_actual})`' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: default:validation:0.7.2
version: default:validate:0.7.2

asserts:
- { type: Equal, actual: <% _data.code %>, expected: 200, msg_pass: 'Response was successful with code `{type_actual}({value_actual})`' }
Expand Down

0 comments on commit 1e747c5

Please sign in to comment.