Skip to content

Commit

Permalink
add test modile docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaqq committed Aug 26, 2024
1 parent d8b491d commit 1175cf7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/test_main_invocations.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Verify that `ops.main` can be invoked in every possible way.
Validate that main can be called at runtime and according to the static type checker.
Runtime tests:
- Ensure that `ops.main` and `ops.main.main` can be invoked with a charm class.
- Across 3 import styles: ops, main from ops, main from ops.main.
- Confirm that calling main without a charm class fails.
Typing tests:
- Ensure that `ops.main` and `ops.main.main` are callable with correct argument.
- Across same 3 import styles as above.
- Confirm that calling main without a charm class is caught by static analysis.
"""

import os
from pathlib import Path
from typing import Callable, Type
Expand Down

0 comments on commit 1175cf7

Please sign in to comment.