pytest-embedded 2.1.0__tar.gz → 2.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pytest_embedded-2.1.0 → pytest_embedded-2.1.2}/PKG-INFO +1 -1
- {pytest_embedded-2.1.0 → pytest_embedded-2.1.2}/pytest_embedded/__init__.py +1 -1
- {pytest_embedded-2.1.0 → pytest_embedded-2.1.2}/tests/test_base.py +41 -1
- {pytest_embedded-2.1.0 → pytest_embedded-2.1.2}/LICENSE +0 -0
- {pytest_embedded-2.1.0 → pytest_embedded-2.1.2}/README.md +0 -0
- {pytest_embedded-2.1.0 → pytest_embedded-2.1.2}/pyproject.toml +0 -0
- {pytest_embedded-2.1.0 → pytest_embedded-2.1.2}/pytest_embedded/app.py +0 -0
- {pytest_embedded-2.1.0 → pytest_embedded-2.1.2}/pytest_embedded/dut.py +0 -0
- {pytest_embedded-2.1.0 → pytest_embedded-2.1.2}/pytest_embedded/dut_factory.py +0 -0
- {pytest_embedded-2.1.0 → pytest_embedded-2.1.2}/pytest_embedded/log.py +0 -0
- {pytest_embedded-2.1.0 → pytest_embedded-2.1.2}/pytest_embedded/plugin.py +0 -0
- {pytest_embedded-2.1.0 → pytest_embedded-2.1.2}/pytest_embedded/unity.py +0 -0
- {pytest_embedded-2.1.0 → pytest_embedded-2.1.2}/pytest_embedded/utils.py +0 -0
|
@@ -283,11 +283,51 @@ def test_expect(testdir):
|
|
|
283
283
|
dut.expect(pattern_list, expect_all=True, timeout=1)
|
|
284
284
|
|
|
285
285
|
assert e.value.value.startswith('Not found "[\'foobar\']"')
|
|
286
|
+
|
|
287
|
+
def test_expect_no_matching_list(dut): # fail
|
|
288
|
+
dut.write('Hello world!')
|
|
289
|
+
dut.write('Restarting')
|
|
290
|
+
dut.expect('world!', not_matching=[re.compile("Hell"), "Hello"])
|
|
291
|
+
|
|
292
|
+
def test_expect_no_matching_word(dut): # fail
|
|
293
|
+
dut.write('Hello world!')
|
|
294
|
+
dut.write('Restarting')
|
|
295
|
+
dut.expect('Restarting', not_matching="Hello world!")
|
|
296
|
+
|
|
297
|
+
def test_expect_no_matching_word_pass(dut):
|
|
298
|
+
dut.write('Hello world!')
|
|
299
|
+
dut.write('Restarting')
|
|
300
|
+
dut.expect('Restarting', not_matching="Hello world!333")
|
|
301
|
+
|
|
302
|
+
def test_expect_no_matching_word_pass_rest(dut):
|
|
303
|
+
dut.write('Hello world!')
|
|
304
|
+
dut.write('Restarting')
|
|
305
|
+
dut.expect('Hello world', not_matching="Restarting")
|
|
306
|
+
|
|
307
|
+
def test_expect_exact_no_matching_list(dut): # fail
|
|
308
|
+
dut.write('Hello world!')
|
|
309
|
+
dut.write('Restarting')
|
|
310
|
+
dut.expect_exact('world!', not_matching=["Hell1", "Hello"])
|
|
311
|
+
|
|
312
|
+
def test_expect_exact_no_matching_word(dut): # fail
|
|
313
|
+
dut.write('Hello world!')
|
|
314
|
+
dut.write('Restarting')
|
|
315
|
+
dut.expect_exact('Restarting', not_matching="Hello world!")
|
|
316
|
+
|
|
317
|
+
def test_expect_exact_no_matching_word_pass(dut):
|
|
318
|
+
dut.write('Hello world!')
|
|
319
|
+
dut.write('Restarting')
|
|
320
|
+
dut.expect_exact('Restarting', not_matching="Hello world!333")
|
|
321
|
+
|
|
322
|
+
def test_expect_exact_no_matching_word_pass_rest(dut):
|
|
323
|
+
dut.write('Hello world!')
|
|
324
|
+
dut.write('Restarting')
|
|
325
|
+
dut.expect_exact('Hello world', not_matching="Restarting")
|
|
286
326
|
""")
|
|
287
327
|
|
|
288
328
|
result = testdir.runpytest()
|
|
289
329
|
|
|
290
|
-
result.assert_outcomes(passed=
|
|
330
|
+
result.assert_outcomes(failed=4, passed=14)
|
|
291
331
|
|
|
292
332
|
|
|
293
333
|
def test_expect_from_timeout(testdir):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|