"Fossies" - the Fresh Open Source Software Archive

Member "polysh-polysh-0.13/tests/tests/display_names.py" (11 May 2020, 1484 Bytes) of package /linux/privat/polysh-polysh-0.13.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "display_names.py" see the Fossies "Dox" file reference documentation.

    1 """Polysh - Tests - Displaying Names
    2 
    3 Copyright (c) 2006 Guillaume Chazarain <guichaz@gmail.com>
    4 Copyright (c) 2018 InnoGames GmbH
    5 """
    6 # This program is free software: you can redistribute it and/or modify
    7 # it under the terms of the GNU General Public License as published by
    8 # the Free Software Foundation, either version 2 of the License, or
    9 # (at your option) any later version.
   10 #
   11 # This program is distributed in the hope that it will be useful,
   12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
   13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   14 # GNU General Public License for more details.
   15 #
   16 # You should have received a copy of the GNU General Public License
   17 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
   18 
   19 import unittest
   20 import pexpect
   21 from polysh_tests import launch_polysh
   22 
   23 
   24 class TestDisplayNames(unittest.TestCase):
   25     def testHole(self):
   26         child = launch_polysh(['--ssh=sh;:'] + ['a'] * 100)
   27         child.expect('ready \(100\)> ')
   28         child.sendline(':disable *1*')
   29         child.expect('ready \(81\)> ')
   30         child.sendline('exit')
   31         child.expect('ready \(0\)> ')
   32         child.sendline(':enable')
   33         child.expect('ready \(19\)> ')
   34         child.sendline(':purge')
   35         child.expect('ready \(19\)> ')
   36         for i in range(20, 101):
   37             child.sendline(':add a')
   38             child.expect('ready \(%d\)> ' % i)
   39         child.sendline(':quit')
   40         child.expect(pexpect.EOF)