コード例 #1
0
 def test_open_json_exception_slash_linux(self):
     file_named = "//this_is_not_right_json"
     with pytest.raises(Exception):
         result = open_json(file_named)
         assert result is None
コード例 #2
0
 def test_open_json_no_file(self):
     file_named = "no_file_name.json"
     with pytest.raises(Exception):
         result = open_json(file_named)
         assert result is None
コード例 #3
0
 def test_open_json_exception_not_str(self):
     file_named = ["a", "list"]
     with pytest.raises(Exception):
         result = open_json(file_named)
         assert result is None
コード例 #4
0
 def test_open_json(self):
     file_named = "test_1.json"
     result = open_json(file_named)
     assert len(result) > 1
     assert isinstance(result, (list, dict))