(self, site, crypt_bitcoin_lib)
| 235 | |
| 236 | |
| 237 | def testVerifyUnsafePattern(self, site, crypt_bitcoin_lib): |
| 238 | site.content_manager.contents["content.json"]["includes"]["data/test_include/content.json"]["files_allowed"] = "([a-zA-Z]+)*" |
| 239 | with pytest.raises(UnsafePatternError) as err: |
| 240 | with site.storage.open("data/test_include/content.json") as data: |
| 241 | site.content_manager.verifyFile("data/test_include/content.json", data, ignore_same=False) |
| 242 | assert "Potentially unsafe" in str(err.value) |
| 243 | |
| 244 | site.content_manager.contents["data/users/content.json"]["user_contents"]["permission_rules"]["([a-zA-Z]+)*"] = {"max_size": 0} |
| 245 | with pytest.raises(UnsafePatternError) as err: |
| 246 | with site.storage.open("data/users/1C5sgvWaSgfaTpV5kjBCnCiKtENNMYo69q/content.json") as data: |
| 247 | site.content_manager.verifyFile("data/users/1C5sgvWaSgfaTpV5kjBCnCiKtENNMYo69q/content.json", data, ignore_same=False) |
| 248 | assert "Potentially unsafe" in str(err.value) |
nothing calls this directly
no test coverage detected