(self)
| 68 | self.assertEqual(parse_gpu_ids(ids), target) |
| 69 | |
| 70 | def test_normalize_gpu_ids(self): |
| 71 | for ids, target in [ |
| 72 | (None, None), |
| 73 | ("0,1,2", ["0", "1", "2"]), |
| 74 | ("MIG-f1e$%^", ["MIG-f1e"]), |
| 75 | ([1, 2, 3], [1, 2, 3]), |
| 76 | ( |
| 77 | [0, "MIG-f1e$%^", "1, 2", "GPU-abcd!"], |
| 78 | [0, "MIG-f1e", "1", "2", "GPU-abcd"], |
| 79 | ), |
| 80 | ([0, {"invalid": "entry"}, "GPU-123"], [0, "GPU-123"]), |
| 81 | ]: |
| 82 | self.assertEqual(normalize_gpu_ids(ids), target) |
| 83 | |
| 84 | @mock.patch.dict( |
| 85 | os.environ, |
nothing calls this directly
no test coverage detected