Skip to content

Commit

Permalink
Small fixes: tasks 12.1, 20.1, 23.2; test 18.1a
Browse files Browse the repository at this point in the history
  • Loading branch information
natenka committed Jan 10, 2022
1 parent 976dbb9 commit a74e3c6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
11 changes: 7 additions & 4 deletions exercises/12_useful_modules/task_12_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
The function expects a list of IP addresses as an argument.
The function must return a tuple with two lists:
* list of available IP addresses
* list of unavailable IP addresses
To check the availability of an IP address, use the ping command.
* list of reachable IP addresses
* list of unreachable IP addresses
To check if an IP address is reachable, use the ping command (use subprocess).
The IP address is considered reachable if the execution of the ping command
completed with return code 0.
Nuances: on Windows, the return code can be 0 not only when ping was successful,
but it is the code that needs to be checked for the job. This is to simplify tests.
Restriction: All tasks must be done using the topics covered in this and previous chapters.
"""
4 changes: 2 additions & 2 deletions exercises/18_ssh_telnet/test_task_18_1a.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_function_return_value(capsys, first_router_wrong_pass):
Function check
"""
return_value = task_18_1a.send_show_command(first_router_wrong_pass, "sh ip int br")
correct_stdout = "Authentication fail"
correct_stdout = "authentication"
out, err = capsys.readouterr()
assert out != "", "Error message not printed to stdout"
assert correct_stdout in out, "Wrong error message printed"
assert correct_stdout in out.lower(), "Wrong error message printed"
4 changes: 4 additions & 0 deletions exercises/20_jinja2/task_20_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
Check the operation of the function on the templates/for.txt template
and data from the data_files/for.yml file.
An important nuance: you need to get the directory from the template parameter,
you cannot specify the current directory in the FileSystemLoader - that is,
DO NOT do this: FileSystemLoader(".").
Specifying the current directory will break the work of other tasks/tests.
"""
import yaml

Expand Down
2 changes: 2 additions & 0 deletions exercises/23_oop_special_methods/task_23_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@
*19:17:20.244 UTC Sat Apr 6 2019
R1#
The test checks the connection with parameters from the devices.yaml file.
The file must contain the parameters of the available devices.
"""

0 comments on commit a74e3c6

Please sign in to comment.