11#!/usr/bin/env python3
22
33import pytest
4+
45from pwncat .modules import IncorrectPlatformError
56
67
@@ -13,13 +14,13 @@ def test_session_iter_users(session):
1314
1415
1516def test_session_find_user_name (session ):
16- """ Test that locating a user by name works """
17+ """Test that locating a user by name works"""
1718
1819 assert session .find_user (name = "john" ) is not None
1920
2021
2122def test_session_find_user_uid (linux ):
22- """ Test locating a user by their UID (for linux only) """
23+ """Test locating a user by their UID (for linux only)"""
2324
2425 user = linux .find_user (uid = 0 )
2526
@@ -28,7 +29,7 @@ def test_session_find_user_uid(linux):
2829
2930
3031def test_session_find_user_sid (windows ):
31- """ Test locating a user by their SID (for windows only) """
32+ """Test locating a user by their SID (for windows only)"""
3233
3334 # This is the SID of the Administrator in the windows servercore image...
3435 # This will only work from the testing container, but I've decided that's fine.
@@ -39,30 +40,30 @@ def test_session_find_user_sid(windows):
3940
4041
4142def test_session_find_module (session ):
42- """ Test that locating modules works """
43+ """Test that locating modules works"""
4344
4445 assert len (list (session .find_module ("enumerate.*" ))) > 0
4546 assert len (list (session .find_module ("enumerate.user" ))) == 1
4647 assert len (list (session .find_module ("module_does_not_exist" ))) == 0
4748
4849
4950def test_session_run_module (session ):
50- """ Test running a module within a session """
51+ """Test running a module within a session"""
5152
5253 # We should be able to enumerate a hostname
5354 facts = session .run ("enumerate" , types = ["system.hostname" ])
5455 assert len (facts ) > 0
5556
5657
5758def test_session_wrong_platform_linux (linux ):
58- """ Test that windows modules don't run in linux """
59+ """Test that windows modules don't run in linux"""
5960
6061 with pytest .raises (IncorrectPlatformError ):
6162 linux .run ("windows.enumerate.user" )
6263
6364
6465def test_session_wrong_platform_windows (windows ):
65- """ Test that linux modules don't run on windows """
66+ """Test that linux modules don't run on windows"""
6667
6768 with pytest .raises (IncorrectPlatformError ):
6869 windows .run ("linux.enumerate.user" )
0 commit comments