コード例 #1
0
 def test_open_txt_exception_not_str(self):
     file_named = ["a", "list"]
     with pytest.raises(Exception):
         result = open_text(file_named)
         assert result is None
コード例 #2
0
 def test_open_text(self):
     file_named = "test_1.html"
     result = open_text(file_named)
     assert "Test" in str(result)
コード例 #3
0
 def test_open_txt_no_file(self):
     file_named = "no_file_name.html"
     with pytest.raises(Exception):
         result = open_text(file_named)
         assert result is None
コード例 #4
0
 def test_open_txt_exception_slash_linux(self):
     file_named = "//this_is_not_right_txt"
     with pytest.raises(Exception):
         result = open_text(file_named)
         assert result is None