-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Showing
10 changed files
with
125 additions
and
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Feature: Cooking | ||
|
||
Scenario: Start cooking food | ||
Given I open the door | ||
And I place an item in the oven | ||
And I close the door | ||
And I press increase timer button 5 times | ||
And I press increase power button | ||
When I press start button | ||
Then heating turns on | ||
|
||
Scenario: Stop cooking food | ||
Given I reproduce "Start cooking food" | ||
When 2 seconds elapsed | ||
Then variable timer equals 3 | ||
When I press stop button | ||
Then variable timer equals 0 | ||
And heating turns off | ||
|
||
Scenario: Cooking stops after preset time | ||
Given I reproduce "Start cooking food" | ||
When 5 seconds elapsed | ||
Then variable timer equals 0 | ||
And heating turns off | ||
|
||
|
This file was deleted.
Oops, something went wrong.
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,24 @@ | ||
Feature: Lighting | ||
|
||
Scenario: Lamp is on when door is open | ||
When I open the door | ||
Then lamp turns on | ||
|
||
Scenario: Lamp is off when door is closed | ||
Given I reproduce "Lamp is on when door is open" | ||
When I close the door | ||
Then lamp turns off | ||
|
||
Scenario: Lamp is on while cooking | ||
Given I open the door | ||
And I place an item in the oven | ||
And I close the door | ||
And I press increase timer button 5 times | ||
When I press start button | ||
Then lamp turns on | ||
|
||
Scenario: Lamp turns off after cooking | ||
Given I reproduce "Lamp is on while cooking" | ||
When I press stop button | ||
Then lamp turns off | ||
|
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,18 @@ | ||
Feature: Safety criterion | ||
|
||
Background: Start cooking food | ||
Given I open the door | ||
And I place an item in the oven | ||
And I close the door | ||
And I press increase timer button 5 times | ||
|
||
Scenario: NO cooking when door is not closed | ||
Given I open the door | ||
When I press start button | ||
Then heating does not turn on | ||
|
||
Scenario: Opening door interrupts cooking | ||
Given I press start button | ||
And 3 seconds elapsed | ||
When I open the door | ||
Then heating turns off |
File renamed without changes.
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,33 @@ | ||
import unittest | ||
from sismic.io import import_from_yaml | ||
from sismic.interpreter import Interpreter | ||
|
||
|
||
class MicrowaveTests(unittest.TestCase): | ||
def setUp(self): | ||
with open('microwave.yaml') as f: | ||
sc = import_from_yaml(f) | ||
|
||
self.oven = Interpreter(sc) | ||
self.oven.execute_once() | ||
|
||
def test_no_heating_when_door_is_not_closed(self): | ||
self.oven.queue('door_opened', 'item_placed', 'timer_inc') | ||
self.oven.execute() | ||
|
||
self.oven.queue('cooking_start') | ||
|
||
for step in iter(self.oven.execute_once, None): | ||
for event in step.sent_events: | ||
self.assertNotEqual(event.name, 'heating_on') | ||
|
||
self.assertNotIn('cooking_mode', self.oven.configuration) | ||
|
||
def test_increase_timer(self): | ||
self.oven.queue('door_opened', 'item_placed', 'door_closed') | ||
|
||
events = 10 * ['timer_inc'] | ||
self.oven.queue(*events) | ||
self.oven.execute() | ||
|
||
self.assertEqual(self.oven.context['timer'], 10) |
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