File: test-limit.sh

package info (click to toggle)
python-gabbi 4.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 972 kB
  • sloc: python: 3,788; makefile: 62; sh: 35
file content (16 lines) | stat: -rwxr-xr-x 564 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env bash
set -ex
# Run a test which is limited to just one request from a file that
# contains many requests and confirm that only one was run and that
# it did actually run.
#
# This covers a situation where the change of intercepts to fixtures
# broke limiting tests and we never knew.

GREP_TEST_MATCH='tests.test_intercept.self_checklimit.test_request ... ok'
GREP_COUNT_MATCH='Ran: 1 '

stestr run "checklimit" && \
    stestr last --subunit | subunit2pyunit 2>&1 | \
    grep "${GREP_TEST_MATCH}" && \
    stestr last | grep "${GREP_COUNT_MATCH}"