File tree 2 files changed +12
-1
lines changed
Variables/Type conversion 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 8
8
placeholder_text : ' "convert it to int here"'
9
9
- name : tests/test_task.py
10
10
visible : false
11
- feedback_link : https://docs.google.com/forms/d/e/1FAIpQLSfRlDlldKfuq-cHMNFfHMER61P1PRIan7KG6yp1GvaweDI7GA/viewform?usp=pp_url&entry.2103429047=Variables+/+Type+Conversion
11
+ feedback_link : https://docs.google.com/forms/d/e/1FAIpQLSfRlDlldKfuq-cHMNFfHMER61P1PRIan7KG6yp1GvaweDI7GA/viewform?usp=pp_url&entry.2103429047=Variables+/+Type+Conversion
Original file line number Diff line number Diff line change @@ -39,3 +39,14 @@ def test_type_conversion(self):
39
39
# TODO comeback and switch it to another assert architecture if the render of the text is not fixed in task view
40
40
self .assertIs (type (actual_converted_float_number ), expected_type , msg = "The variable doesn't seem to be an integer "
41
41
"yet. Please convert it!" )
42
+
43
+ def test_0_code_len (self ):
44
+ with open ("type_cast.py" , "r" ) as taskfile :
45
+ lines = taskfile .readlines ()
46
+ self .assertTrue (len (lines ) == 10 , msg = "Please do not add or remove any lines from the code file." )
47
+
48
+ def test_statement_1 (self ):
49
+ with open ("type_cast.py" , "r" ) as taskfile :
50
+ lines = taskfile .readlines ()
51
+ code = lines [- 3 ]
52
+ self .assertTrue ("int(" in code , msg = "Your expression does not perform a type conversion." )
You can’t perform that action at this time.
0 commit comments