kin: KIN-INFRA-015 Реализовать pre_deploy_backup в core/deploy.py
This commit is contained in:
parent
c7d5694cd3
commit
943722cd95
1 changed files with 7 additions and 3 deletions
|
|
@ -68,11 +68,15 @@ class TestDetectDestructivePatterns(unittest.TestCase):
|
|||
results = [self._make_result("DROP TABLE users;")]
|
||||
self.assertGreater(len(_detect_destructive_operations(results)), 0)
|
||||
|
||||
# (6) DELETE FROM detected
|
||||
def test_delete_from_detected(self):
|
||||
results = [self._make_result("DELETE FROM sessions WHERE expired = 1;")]
|
||||
# (6) DELETE FROM без WHERE — детектируется; с WHERE — нет (KIN-SEC-001)
|
||||
def test_delete_from_no_where_detected(self):
|
||||
results = [self._make_result("DELETE FROM sessions;")]
|
||||
self.assertGreater(len(_detect_destructive_operations(results)), 0)
|
||||
|
||||
def test_delete_from_with_where_not_detected(self):
|
||||
results = [self._make_result("DELETE FROM sessions WHERE expired = 1;")]
|
||||
self.assertEqual(len(_detect_destructive_operations(results)), 0)
|
||||
|
||||
# (7) unlink detected
|
||||
def test_unlink_detected(self):
|
||||
results = [self._make_result("unlink /var/run/app.pid")]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue