Commit e51ff94
authored
Add comprehensive tests for
* test: Add test for `VARIANTEnumerator` in `test_server_automation.py`
This commit introduces a new test file `test/test_server_automation.py`
containing `TestVARIANTEnumerator`. This test class verifies the functionality
by creating and enumerating `IDispatch` objects and asserting the correct
behavior of the `Next` method of `IEnumVARIANT`.
* test: Add test for `IEnumVARIANT.Next` with multiple items
Refactored `test_Next` to `test_Next_single_item` and added
`test_Next_multiple_items` to `TestVARIANTEnumerator` in
`test_server_automation.py`. This new test verifies that `IEnumVARIANT.Next`
can correctly fetch multiple items at once, ensuring proper handling of the
`celt` parameter.
* test: Add test for `IEnumVARIANT.Skip` method
This commit introduces a new test method `test_Skip` to
`TestVARIANTEnumerator` in `test_server_automation.py`.
This test verifies the functionality of `IEnumVARIANT.Skip` by
testing various skip scenarios, including skipping zero items, a single
item, and more items than available, asserting correct return values
for `Skip` and subsequent `Next` calls.
* test: Add test for `IEnumVARIANT.Reset` method
This commit introduces a new test method `test_Reset` to
`TestVARIANTEnumerator` in `test/test_server_automation.py`.
This test verifies the functionality of `IEnumVARIANT.Reset` by advancing the
enumerator, resetting it, and then asserting that subsequent `Next` calls
return items from the beginning of the enumeration.
* test: Add test for `IEnumVARIANT.Clone` method (results in `E_NOTIMPL`)
This commit introduces a new test method `test_Clone` to `TestVARIANTEnumerator`
in `test_server_automation.py`.
This test verifies that calling `IEnumVARIANT.Clone` on a `VARIANTEnumerator`
raises a `COMError` with `hresult.E_NOTIMPL`, as the `Clone` method is not
implemented.
* test: Add tests for `VARIANTEnumerator` Python protocol support
This commit introduces new test methods `test_dunder_iter` and
`test_dunder_getitem` to `TestVARIANTEnumerator` in
`test/test_server_automation.py`.
`test_dunder_iter` verifies iteration support for `IEnumVARIANT`
through `VARIANTEnumerator`. `test_dunder_getitem` confirms indexed
access support and proper `IndexError` handling for out-of-bounds access.VARIANTEnumerator. (#913)1 parent da3634c commit e51ff94
1 file changed
Lines changed: 135 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
0 commit comments