add test for community script shell type
This commit is contained in:
parent
e17d25c156
commit
b7578d939f
|
@ -195,4 +195,4 @@
|
|||
"description": "Windows Defender Exclusions for Tactical RMM",
|
||||
"shell": "powershell"
|
||||
}
|
||||
]
|
||||
]
|
|
@ -195,15 +195,21 @@ class TestScriptViews(TacticalTestCase):
|
|||
info = json.load(f)
|
||||
|
||||
for script in info:
|
||||
self.assertTrue(
|
||||
os.path.exists(os.path.join(scripts_dir, script["filename"]))
|
||||
)
|
||||
fn: str = script["filename"]
|
||||
self.assertTrue(os.path.exists(os.path.join(scripts_dir, fn)))
|
||||
self.assertTrue(script["filename"])
|
||||
self.assertTrue(script["name"])
|
||||
self.assertTrue(script["description"])
|
||||
self.assertTrue(script["shell"])
|
||||
self.assertIn(script["shell"], valid_shells)
|
||||
|
||||
if fn.endswith(".ps1"):
|
||||
self.assertEqual(script["shell"], "powershell")
|
||||
elif fn.endswith(".bat"):
|
||||
self.assertEqual(script["shell"], "cmd")
|
||||
elif fn.endswith(".py"):
|
||||
self.assertEqual(script["shell"], "python")
|
||||
|
||||
def test_load_community_scripts(self):
|
||||
with open(
|
||||
os.path.join(settings.BASE_DIR, "scripts/community_scripts.json")
|
||||
|
|
Loading…
Reference in New Issue