|
| 1 | +# Copyright (c) Microsoft Corporation. |
| 2 | +# Licensed under the MIT license. |
| 3 | + |
| 4 | +import unittest |
| 5 | + |
| 6 | +from PowerPlatform.Dataverse import operations |
| 7 | +from PowerPlatform.Dataverse.operations import ( |
| 8 | + BatchDataFrameOperations, |
| 9 | + BatchOperations, |
| 10 | + BatchQueryOperations, |
| 11 | + BatchRecordOperations, |
| 12 | + BatchRequest, |
| 13 | + BatchTableOperations, |
| 14 | + ChangeSet, |
| 15 | + ChangeSetRecordOperations, |
| 16 | + DataFrameOperations, |
| 17 | + FileOperations, |
| 18 | + QueryOperations, |
| 19 | + RecordOperations, |
| 20 | + TableOperations, |
| 21 | +) |
| 22 | + |
| 23 | + |
| 24 | +class TestOperationsPackageExports(unittest.TestCase): |
| 25 | + """Tests for package-level exports in PowerPlatform.Dataverse.operations.""" |
| 26 | + |
| 27 | + def test_package_level_imports_work(self): |
| 28 | + """Expected operation namespace classes are importable from package root.""" |
| 29 | + self.assertIs(operations.RecordOperations, RecordOperations) |
| 30 | + self.assertIs(operations.QueryOperations, QueryOperations) |
| 31 | + self.assertIs(operations.TableOperations, TableOperations) |
| 32 | + self.assertIs(operations.FileOperations, FileOperations) |
| 33 | + self.assertIs(operations.DataFrameOperations, DataFrameOperations) |
| 34 | + |
| 35 | + self.assertIs(operations.BatchOperations, BatchOperations) |
| 36 | + self.assertIs(operations.BatchRecordOperations, BatchRecordOperations) |
| 37 | + self.assertIs(operations.BatchQueryOperations, BatchQueryOperations) |
| 38 | + self.assertIs(operations.BatchTableOperations, BatchTableOperations) |
| 39 | + self.assertIs(operations.BatchDataFrameOperations, BatchDataFrameOperations) |
| 40 | + self.assertIs(operations.BatchRequest, BatchRequest) |
| 41 | + self.assertIs(operations.ChangeSet, ChangeSet) |
| 42 | + self.assertIs(operations.ChangeSetRecordOperations, ChangeSetRecordOperations) |
| 43 | + |
| 44 | + def test_all_exports_include_expected_symbols(self): |
| 45 | + """__all__ should expose the package-level operation symbols.""" |
| 46 | + expected_exports = { |
| 47 | + "BatchDataFrameOperations", |
| 48 | + "BatchOperations", |
| 49 | + "BatchQueryOperations", |
| 50 | + "BatchRecordOperations", |
| 51 | + "BatchRequest", |
| 52 | + "BatchTableOperations", |
| 53 | + "ChangeSet", |
| 54 | + "ChangeSetRecordOperations", |
| 55 | + "DataFrameOperations", |
| 56 | + "FileOperations", |
| 57 | + "QueryOperations", |
| 58 | + "RecordOperations", |
| 59 | + "TableOperations", |
| 60 | + } |
| 61 | + self.assertEqual(set(operations.__all__), expected_exports) |
0 commit comments