8000 gh-95011: Migrate syslog module to Argument Clinic by noamcohen97 · Pull Request #95012 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-95011: Migrate syslog module to Argument Clinic #95012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Oct 8, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Prev Previous commit
Next Next commit
Merge branch 'main' into clinic-syslog
  • Loading branch information
noamcohen97 committed Sep 7, 2022
commit 0e0d9c69a62e06d302d26b7edc92d016d3e931cb
11 changes: 11 additions & 0 deletions Lib/test/audit-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,17 @@ def hook(event, args):
sys._getframe()


def test_wmi_exec_query():
import _wmi

def hook(event, args):
if event.startswith("_wmi."):
print(event, args[0])

sys.addaudithook(hook)
_wmi.exec_query("SELECT * FROM Win32_OperatingSystem")


def test_syslog():
import syslog

Expand Down
17 changes: 17 additions & 0 deletions Lib/test/test_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,26 @@ def test_sys_getframe(self):

self.assertEqual(actual, expected)


def test_wmi_exec_query(self):
import_helper.import_module("_wmi")
returncode, events, stderr = self.run_python("test_wmi_exec_query")
if returncode:
self.fail(stderr)

if support.verbose:
print(*events, sep='\n')
actual = [(ev[0], ev[2]) for ev in events]
expected = [("_wmi.exec_query", "SELECT * FROM Win32_OperatingSystem")]

self.assertEqual(actual, expected)


def test_syslog(self):
syslog = import_helper.import_module("syslog")

returncode, events, stderr = self.run_python("test_syslog")

if returncode:
self.fail(stderr)

Expand All @@ -203,5 +219,6 @@ def test_syslog(self):
events
)


if __name__ == "__main__":
unittest.main()
You are viewing a condensed version of this merge commit. You can view the full changes here.
0