Josiah Kaviani
Josiah Kaviani
Wrap command stories with one that prepare state for it (query stories). ```python CreatePost( # parse http hearders # load current user SavePost() ) ```
```python class A1(Story): I.a1s1 I.a1s2 x = None # error ``` The rule applies even if unknown attribute is a proper step definition `def a1s99(self, state):`.
State subclass attribute value should be `Argument` or `Variable` placeholders. ```python class A1(State): # error foo = 1 ```
```python class A1State(State, X): # error pass ``` The rule applies even if mixed class is a state.
If user supply validator argument to the `Argument` or `Variable` placeholders we should check if passed thing supports callable interface.
```python from stories import I, Story, unless class Action(Story): I.one unless("foo") > I.two I.three ```
```python from stories import I, Story, when class Action(Story): I.one when("foo") > I.two I.three ```
```python class A1(Story): I.a1s1 I.a1s2 def a1s1(self, state): return 1 # error ``` We can't protect from `return None` and we don't care.
```python class A1(Story, A2): # error pass ``` The rule applies even if mixed class is a story.