Skip to content
This repository was archived by the owner on Nov 16, 2020. It is now read-only.

Commit 41b8e22

Browse files
authored
Update README.md
1 parent 7372d9e commit 41b8e22

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

unittest/README.md

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ $ pip install mock
9999

100100
#### Console Output
101101

102+
**test script** [mqtt_rule_test.py](https://github.com/phyunsj/mqtt-rule-engine/blob/master/unittest/mqtt_rule_test.py)
103+
102104
```
103105
$ python --version
104106
Python 2.7.15
@@ -123,20 +125,4 @@ OK
123125
$
124126
```
125127

126-
#### test script : [mqtt_rule_test.py](https://github.com/phyunsj/mqtt-rule-engine/blob/master/unittest/mqtt_rule_test.py)
127-
128128

129-
```
130-
...
131-
# expect { 'temperature' : 110 } since temperature > 100.
132-
def test_4_filter_warn(self):
133-
self.mock_callback.reset_mock()
134-
print("Publishing message to topic","city/building12/floor1/temperature")
135-
self.client.publish("city/building12/floor1/temperature","110")
136-
time.sleep(5)
137-
self.assertTrue(self.mock_callback.called)
138-
name, args, kwargs = self.mock_callback.mock_calls[0]
139-
# args[2] : MQTT Message
140-
self.assertEqual( args[2].payload , "{ 'temperature' : 110 }")
141-
...
142-
```

0 commit comments

Comments
 (0)