CS代写 #!/usr/bin/python3

#!/usr/bin/python3
#####################################################
############# LEAVE CODE BELOW ALONE #############
# Include base directory into path

Copyright By PowCoder代写 加微信 powcoder

import os, sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname( __file__ ), ‘..’, ‘..’)))

# Import tester
from tester import failtest, passtest, assertequals, runcmd, preparefile, runcmdsafe
############# END UNTOUCHABLE CODE #############
#####################################################

###################################
# Write your testing script below #
###################################
python_bin = sys.executable
import pickle

# prepare necessary files
preparefile(‘./test.rkt’)

# run test file
runcmdsafe(‘rm ./output’)
b_stdout, b_stderr, b_exitcode = runcmdsafe(f’racket ./test.rkt’)

# convert stdout bytes to utf-8
stdout = “”
stderr = “”
stdout = b_stdout.decode(‘utf-8’)
stderr = b_stderr.decode(‘utf-8’)

# stdout comparison with expected.txt here
with open(‘answer’, ‘rb’) as file1, open(‘output’, ‘rb’) as file2:
answer = file1.read()
output = file2.read()
if answer == output:
passtest(”)
failtest(stdout+”\n\n”+stderr)
except FileNotFoundError:
failtest(stdout+”\n\n”+stderr)

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com