<commit_before>#!/usr/bin/env python
import pexpect
import unittest
import time
import PexpectTestCase

class TestCaseConstructor(PexpectTestCase.PexpectTestCase):
    def test_constructor (self):
        """This tests that the constructor will work and give
        the same results for different styles of invoking __init__().
        This assumes that the root directory / is static during the test.
        """
        p1 = pexpect.spawn('ls -l /bin')
        p2 = pexpect.spawn('/bin/ls' ,['-l', '/bin'])
        p1.expect (pexpect.EOF)
        p2.expect (pexpect.EOF)
        assert (p1.before == p2.before)

    def test_named_parameters (self):
        """This tests that named parameters work.
        """
        p = pexpect.spawn ('/bin/ls',timeout=10)
        p = pexpect.spawn (timeout=10, command='ls')
        p = pexpect.spawn (args=[], command='/bin/ls')

if __name__ == '__main__':
    unittest.main()

suite = unittest.makeSuite(TestCaseConstructor,'test')

<commit_msg>Strange, but Solaris 'ls' prints output differently if called as 'ls' versus '/bin/ls'. I might be wrong because that doesn't make sense.<commit_after>#!/usr/bin/env python
import pexpect
import unittest
import time
import PexpectTestCase

class TestCaseConstructor(PexpectTestCase.PexpectTestCase):
    def test_constructor (self):
        """This tests that the constructor will work and give
        the same results for different styles of invoking __init__().
        This assumes that the root directory / is static during the test.
        """
        p1 = pexpect.spawn('/bin/ls -l /bin')
        p2 = pexpect.spawn('/bin/ls' ,['-l', '/bin'])
        p1.expect (pexpect.EOF)
        p2.expect (pexpect.EOF)
	print p1.before
	print p2.before
        assert (p1.before == p2.before)

    def test_named_parameters (self):
        """This tests that named parameters work.
        """
        p = pexpect.spawn ('/bin/ls',timeout=10)
        p = pexpect.spawn (timeout=10, command='ls')
        p = pexpect.spawn (args=[], command='/bin/ls')

if __name__ == '__main__':
    unittest.main()

suite = unittest.makeSuite(TestCaseConstructor,'test')


{'fraction_non_alphanumeric': 0.12237272302662307, 'fraction_numerical': 0.010275572162540868, 'mean_word_length': 2.908759124087591, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1059444', 'n_tokens_mistral': 655, 'n_tokens_neox': 650, 'n_words': 195}