Skip to content

Commit

Permalink
REFACTOR : Remove Ensure library from tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
crdoconnor committed Apr 26, 2023
1 parent e1025d4 commit 810e2db
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
13 changes: 6 additions & 7 deletions hitch/story/single-value.story
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Single value:
given:
setup: |
from strictyaml import Str, Int, load
from ensure import Ensure
variations:
Raise exception on None:
steps:
Expand All @@ -24,34 +23,34 @@ Single value:
steps:
- Run:
code: |
Ensure(load("1", Str())).equals("1")
assert load("1", Str()) == "1"
Int of 1:
steps:
- Run:
code: |
Ensure(load("1", Int())).equals(1)
assert load("1", Int()) == 1
Empty value parsed as blank string by default:
steps:
- Run:
code: |
Ensure(load("x:")).equals({"x": ""})
assert load("x:") == {"x": ""}
Empty document parsed as blank string by default:
steps:
- Run:
code: |
Ensure(load("", Str())).equals("")
assert load("", Str()) == ""
Null parsed as string null by default:
steps:
- Run:
code: |
Ensure(load("null: null")).equals({"null": "null"})
assert load("null: null") == {"null": "null"}
#Single value with comment:
#steps:
#- Run:
#code: |
#Ensure(load("# ought not to be parsed\nstring")).equals("string")
#assert load("# ought not to be parsed\nstring") == "string"
3 changes: 1 addition & 2 deletions hitch/story/unique-sequence.story
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ Sequences of unique items (UniqueSeq):
- C
setup: |
from strictyaml import UniqueSeq, Str, load, as_document
from ensure import Ensure
schema = UniqueSeq(Str())
variations:
Valid:
steps:
- Run:
code: |
Ensure(load(yaml_snippet, schema)).equals(["A", "B", "C", ])
assert load(yaml_snippet, schema) == ["A", "B", "C", ]
Parsing with one dupe raises an exception:
given:
Expand Down
1 change: 0 additions & 1 deletion hitch/story/update-with-schema.story
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Updating document with a schema:
given:
setup: |
import strictyaml as s
from ensure import Ensure
variations:
GitHub \#72:
steps:
Expand Down

0 comments on commit 810e2db

Please sign in to comment.