Skip to content

Commit

Permalink
Update unit tests for spaces in terminal header environment
Browse files Browse the repository at this point in the history
  • Loading branch information
acbart committed May 1, 2024
1 parent 1a64e3e commit 76666ff
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions tests/test_environment_terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ def test_correct(self):
terminal.resolve()
clear_report()
self.checkFeedback(f.getvalue(), '''
[;7mYOUR CODE[0;0m We ran your code. Here's the output:
[;7m YOUR CODE [0;0m We ran your code. Here's the output:
[;7mFEEDBACK[0;0m Based on your code, here are some tips and recommendations:
[;7m FEEDBACK [0;0m Based on your code, here are some tips and recommendations:
✓️ Your code ran successfully.
Expand All @@ -46,10 +46,10 @@ def test_empty_source(self):
terminal.resolve()
clear_report()
self.checkFeedback(f.getvalue(), '''
[;7mYOUR CODE[0;0m We ran your code. Here's the output:
[;7m YOUR CODE [0;0m We ran your code. Here's the output:
[;7mFEEDBACK[0;0m Based on your code, here are some tips and recommendations:
[;7m FEEDBACK [0;0m Based on your code, here are some tips and recommendations:
✗ No Source Code
Expand All @@ -62,17 +62,17 @@ def test_syntax_error(self):
terminal.resolve()
clear_report()
self.checkFeedback(f.getvalue(), '''
[;7mYOUR CODE[0;0m We ran your code. Here's the output:
[;7m YOUR CODE [0;0m We ran your code. Here's the output:
[;7mFEEDBACK[0;0m Based on your code, here are some tips and recommendations:
[;7m FEEDBACK [0;0m Based on your code, here are some tips and recommendations:
✗ Syntax Error
Bad syntax on line 1.
Suggestion: Check line 1, the line before it, and the line after it. Ignore blank lines.
[;7mTERMINAL OUTPUT[0;0m For reference, here is the original Python error:
[;7m TERMINAL OUTPUT [0;0m For reference, here is the original Python error:
Line 1 of file answer.py
1 1 2 3
Expand All @@ -86,16 +86,16 @@ def test_tifa_feedback(self):
terminal.resolve()
clear_report()
self.checkFeedback(f.getvalue(), '''
[;7mYOUR CODE[0;0m We ran your code. Here's the output:
[;7m YOUR CODE [0;0m We ran your code. Here's the output:
[;7mFEEDBACK[0;0m Based on your code, here are some tips and recommendations:
[;7m FEEDBACK [0;0m Based on your code, here are some tips and recommendations:
✗ Incompatible types
You used an addition operation with an integer and a string on line 1. But you can't do that with that operator. Make sure both sides of the operator are the right type.
[;7mTERMINAL OUTPUT[0;0m For reference, here is the original Python error:
[;7m TERMINAL OUTPUT [0;0m For reference, here is the original Python error:
Line 1 of file answer.py
1+''
Expand All @@ -109,10 +109,10 @@ def test_runtime_feedback(self):
terminal.resolve()
clear_report()
self.checkFeedback(f.getvalue(), '''
[;7mYOUR CODE[0;0m We ran your code. Here's the output:
[;7m YOUR CODE [0;0m We ran your code. Here's the output:
[;7mFEEDBACK[0;0m Based on your code, here are some tips and recommendations:
[;7m FEEDBACK [0;0m Based on your code, here are some tips and recommendations:
✗ Type Error
Expand All @@ -126,7 +126,7 @@ def test_runtime_feedback(self):
Suggestion: To fix a type error, you should trace through your code. Make sure each expression has the type you expect it to have.
[;7mTERMINAL OUTPUT[0;0m For reference, here is the original Python error:
[;7m TERMINAL OUTPUT [0;0m For reference, here is the original Python error:
Line 2 of file answer.py
json.loads('1')+''
Expand All @@ -141,16 +141,16 @@ def test_explain(self):
terminal.resolve()
clear_report()
self.checkFeedback(f.getvalue(), '''
[;7mYOUR CODE[0;0m We ran your code. Here's the output:
[;7m YOUR CODE [0;0m We ran your code. Here's the output:
[;7mFEEDBACK[0;0m Based on your code, here are some tips and recommendations:
[;7m FEEDBACK [0;0m Based on your code, here are some tips and recommendations:
✗ Instructor Feedback
You should not be using the JSON library at all.
[;7mTERMINAL OUTPUT[0;0m For reference, here is the original Python error:
[;7m TERMINAL OUTPUT [0;0m For reference, here is the original Python error:
Line 2 of file answer.py
json.loads('1')+''
Expand All @@ -166,10 +166,10 @@ def test_call_assertion(self):
terminal.resolve()
clear_report()
self.checkFeedback(f.getvalue(), '''
[;7mYOUR CODE[0;0m We ran your code. Here's the output:
[;7m YOUR CODE [0;0m We ran your code. Here's the output:
[;7mFEEDBACK[0;0m Based on your code, here are some tips and recommendations:
[;7m FEEDBACK [0;0m Based on your code, here are some tips and recommendations:
✗ Type Error
Expand All @@ -184,7 +184,7 @@ def test_call_assertion(self):
Suggestion: To fix a type error, you should trace through your code. Make sure each expression has the type you expect it to have.
[;7mTERMINAL OUTPUT[0;0m For reference, here is the original Python error:
[;7m TERMINAL OUTPUT [0;0m For reference, here is the original Python error:
Line 1 of file answer.py in x
def x(): return 1+''
Expand Down

0 comments on commit 76666ff

Please sign in to comment.