Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about test suite #126

Open
hpreusse opened this issue Sep 16, 2021 · 1 comment
Open

Question about test suite #126

hpreusse opened this issue Sep 16, 2021 · 1 comment

Comments

@hpreusse
Copy link

I noticed that is a file pssh/test/test.py, which I assume some kind of test suite. I tried to run in and got an error message using python 3.9:

hille@debian-amd64-sid:~/devel/pssh/pssh.git$ python3 test/test.py
  File "/home/hille/devel/pssh/pssh.git/test/test.py", line 279
    print cmd
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(cmd)?

I don't know python at all, but after changing the file as suggested the error message is gone.

Then I had to define 2 env vars TEST_HOSTS & TEST_USER and now the call prints something like

hille@debian-amd64-sid:~/devel/pssh/pssh.git$ python3 test/test.py
The authenticity of host '127.0.0.1 (127.0.0.1)' can't be established.
ECDSA key fingerprint is SHA256:0AtcX02pfNoUbB4bwRkVpwab2HhlbvAQ/bo4pnqIJW0.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '127.0.0.1' (ECDSA) to the list of known hosts.
EEEEEEEEEEE
======================================================================
ERROR: testLongOpts (__main__.PsshTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hille/devel/pssh/pssh.git/test/test.py", line 47, in testLongOpts
    hostsFile.write("".join(map(lambda x: "%s\n" % x, g_hosts)))
  File "/usr/lib/python3.9/tempfile.py", line 613, in func_wrapper
    return func(*args, **kwargs)
TypeError: a bytes-like object is required, not 'str'

Still I do now get how to use that unit test. Would be nice if the useage could be documened anywhere. Many thanks!

@lilydjwg
Copy link
Owner

It's old Python 2 code. They won't work in Python 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants