File: ansi_steps.py

package info (click to toggle)
behave 1.2.6-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,160 kB
  • sloc: python: 19,857; makefile: 137; sh: 18
file content (19 lines) | stat: -rw-r--r-- 689 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# -*- coding: utf-8 -*-

from __future__ import absolute_import
from behave import then
from behave4cmd0.command_steps import \
    step_command_output_should_contain_text, \
    step_command_output_should_not_contain_text

# -- CONSTANTS:
# ANSI CONTROL SEQUENCE INTRODUCER (CSI).
CSI = u"\x1b["

@then(u'the command output should contain ANSI escape sequences')
def step_command_ouput_should_contain_ansi_sequences(context):
    step_command_output_should_contain_text(context, CSI)

@then(u'the command output should not contain any ANSI escape sequences')
def step_command_ouput_should_not_contain_ansi_sequences(context):
    step_command_output_should_not_contain_text(context, CSI)