Skip to content

Commit

Permalink
github_actions: fixed unit tests for github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ader1990 committed Nov 3, 2023
1 parent 0b4a32a commit 25e6d68
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions wmi/tests/functional/test_basic_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# License for the specific language governing permissions and limitations
# under the License.

import os
import time

import wmi
Expand Down Expand Up @@ -47,12 +46,17 @@ def test_invoke_method(self, temp_file_path):
self.assertEqual(content, actual_content)

def test_associators(self):
logical_disk = self._conn_cimv2.Win32_LogicalDisk()[0]
root_dir = logical_disk.associators(
wmi_association_class="Win32_LogicalDiskRootDirectory")[0]

self.assertEqual(logical_disk.Name.lower(),
root_dir.Name.lower().strip('\\'))
logical_disks = self._conn_cimv2.Win32_LogicalDisk()
found_associators = False
for logical_disk in logical_disks:
root_dirs = logical_disk.associators(
wmi_association_class="Win32_LogicalDiskRootDirectory")
if len(root_dirs) == 1:
found_associators = True
root_dir = root_dirs[0]
self.assertEqual(logical_disk.Name.lower(),
root_dir.Name.lower().strip('\\'))
self.assertTrue(found_associators)

def test_new_conn_invalid_creds(self):
err_code = None
Expand Down

0 comments on commit 25e6d68

Please sign in to comment.