File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ def __init__(
7979 self .params = list ()
8080
8181 for k , v in args .items ():
82- if k not in [ "self" , "args" ] :
82+ if k != "self" :
8383 self .params .append (k )
8484 setattr (self , k , v )
8585
Original file line number Diff line number Diff line change 1+ from tempfile import NamedTemporaryFile
2+
3+ import pytest
4+ import tests .helper as helper
5+ from protowhat .sct_syntax import F
6+
7+ from pythonwhat .local import setup_state
8+ from protowhat .checks import check_files as cf
9+
10+
11+ @pytest .fixture (scope = "function" )
12+ def tf ():
13+ with NamedTemporaryFile () as tmp :
14+ tmp .file .write (b"1 + 1" )
15+ tmp .file .flush ()
16+ yield tmp
17+
18+
19+ def test_file_existence (tf ):
20+ s = setup_state ("" , "" , pec = "" )
21+
22+ child = cf .check_file (s ._state , tf .name )
23+ assert "1 + 1" in child .student_code
24+
25+ file_chain = s .check_file (tf .name )
26+ assert "1 + 1" in file_chain ._state .student_code
27+
28+ with helper .verify_sct (True ):
29+ s >> F (attr_scts = {"check_file" : cf .check_file }).check_file (tf .name )
You can’t perform that action at this time.
0 commit comments