(self)
| 26 | |
| 27 | class WmiTests(unittest.TestCase): |
| 28 | def test_wmi_query_os_version(self): |
| 29 | r = wmi_exec_query("SELECT Version FROM Win32_OperatingSystem").split("\0") |
| 30 | self.assertEqual(1, len(r)) |
| 31 | k, eq, v = r[0].partition("=") |
| 32 | self.assertEqual("=", eq, r[0]) |
| 33 | self.assertEqual("Version", k, r[0]) |
| 34 | # Best we can check for the version is that it's digits, dot, digits, anything |
| 35 | # Otherwise, we are likely checking the result of the query against itself |
| 36 | self.assertRegex(v, r"\d+\.\d+.+$", r[0]) |
| 37 | |
| 38 | def test_wmi_query_repeated(self): |
| 39 | # Repeated queries should not break |
no test coverage detected