Class Assertions

java.lang.Object
org.openrewrite.python.Assertions

public final class Assertions extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.openrewrite.test.SourceSpecs
    pipfile(@Nullable String before)
     
    static org.openrewrite.test.SourceSpecs
    pipfile(@Nullable String before, @Nullable String after)
     
    static org.openrewrite.test.SourceSpecs
    pipfile(@Nullable String before, @Nullable String after, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.toml.tree.Toml.Document>> spec)
     
    static org.openrewrite.test.SourceSpecs
    pipfile(@Nullable String before, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.toml.tree.Toml.Document>> spec)
     
    static org.openrewrite.test.SourceSpecs
    pyproject(@Nullable String before)
     
    static org.openrewrite.test.SourceSpecs
    pyproject(@Nullable String before, @Nullable String after)
     
    static org.openrewrite.test.SourceSpecs
    pyproject(@Nullable String before, @Nullable String after, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.toml.tree.Toml.Document>> spec)
     
    static org.openrewrite.test.SourceSpecs
    pyproject(@Nullable String before, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.toml.tree.Toml.Document>> spec)
     
    static org.openrewrite.test.SourceSpecs
    python(@Nullable String before)
     
    static org.openrewrite.test.SourceSpecs
    python(@Nullable String before, String after)
     
    static org.openrewrite.test.SourceSpecs
    python(@Nullable String before, String after, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.python.tree.Py.CompilationUnit>> spec)
     
    static org.openrewrite.test.SourceSpecs
    python(@Nullable String before, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.python.tree.Py.CompilationUnit>> spec)
     
    static org.openrewrite.test.SourceSpecs
    requirementsTxt(@Nullable String before)
     
    static org.openrewrite.test.SourceSpecs
    requirementsTxt(@Nullable String before, @Nullable String after)
     
    static org.openrewrite.test.SourceSpecs
    requirementsTxt(@Nullable String before, @Nullable String after, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.text.PlainText>> spec)
     
    static org.openrewrite.test.SourceSpecs
    requirementsTxt(@Nullable String before, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.text.PlainText>> spec)
     
    static org.openrewrite.test.SourceSpecs
    setupCfg(@Nullable String before)
     
    static org.openrewrite.test.SourceSpecs
    setupCfg(@Nullable String before, @Nullable String after)
     
    static org.openrewrite.test.SourceSpecs
    setupCfg(@Nullable String before, @Nullable String after, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.text.PlainText>> spec)
     
    static org.openrewrite.test.SourceSpecs
    setupCfg(@Nullable String before, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.text.PlainText>> spec)
     
    static org.openrewrite.test.SourceSpecs
    uv(Path relativeTo, org.openrewrite.test.SourceSpecs... sources)
    Sets up a Python project with dependencies installed for type attribution.
    static org.openrewrite.test.SourceSpecs
    uvLock(@Nullable String before)
     
    static org.openrewrite.test.SourceSpecs
    uvLock(@Nullable String before, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.toml.tree.Toml.Document>> spec)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • uv

      public static org.openrewrite.test.SourceSpecs uv(Path relativeTo, org.openrewrite.test.SourceSpecs... sources)
      Sets up a Python project with dependencies installed for type attribution. Similar to the JavaScript npm() helper, this creates a cached workspace with dependencies from pyproject.toml and symlinks the virtual environment.
      Parameters:
      relativeTo - The test directory where files should be written
      sources - Source specs including Python files and optionally pyproject.toml
      Returns:
      SourceSpecs wrapped in a directory context
    • pyproject

      public static org.openrewrite.test.SourceSpecs pyproject(@Language("toml") @Nullable String before)
    • pyproject

      public static org.openrewrite.test.SourceSpecs pyproject(@Language("toml") @Nullable String before, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.toml.tree.Toml.Document>> spec)
    • pyproject

      public static org.openrewrite.test.SourceSpecs pyproject(@Language("toml") @Nullable String before, @Language("toml") @Nullable String after)
    • pyproject

      public static org.openrewrite.test.SourceSpecs pyproject(@Language("toml") @Nullable String before, @Language("toml") @Nullable String after, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.toml.tree.Toml.Document>> spec)
    • uvLock

      public static org.openrewrite.test.SourceSpecs uvLock(@Language("toml") @Nullable String before)
    • uvLock

      public static org.openrewrite.test.SourceSpecs uvLock(@Language("toml") @Nullable String before, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.toml.tree.Toml.Document>> spec)
    • requirementsTxt

      public static org.openrewrite.test.SourceSpecs requirementsTxt(@Nullable String before)
    • requirementsTxt

      public static org.openrewrite.test.SourceSpecs requirementsTxt(@Nullable String before, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.text.PlainText>> spec)
    • requirementsTxt

      public static org.openrewrite.test.SourceSpecs requirementsTxt(@Nullable String before, @Nullable String after)
    • requirementsTxt

      public static org.openrewrite.test.SourceSpecs requirementsTxt(@Nullable String before, @Nullable String after, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.text.PlainText>> spec)
    • setupCfg

      public static org.openrewrite.test.SourceSpecs setupCfg(@Nullable String before)
    • setupCfg

      public static org.openrewrite.test.SourceSpecs setupCfg(@Nullable String before, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.text.PlainText>> spec)
    • setupCfg

      public static org.openrewrite.test.SourceSpecs setupCfg(@Nullable String before, @Nullable String after)
    • setupCfg

      public static org.openrewrite.test.SourceSpecs setupCfg(@Nullable String before, @Nullable String after, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.text.PlainText>> spec)
    • pipfile

      public static org.openrewrite.test.SourceSpecs pipfile(@Language("toml") @Nullable String before)
    • pipfile

      public static org.openrewrite.test.SourceSpecs pipfile(@Language("toml") @Nullable String before, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.toml.tree.Toml.Document>> spec)
    • pipfile

      public static org.openrewrite.test.SourceSpecs pipfile(@Language("toml") @Nullable String before, @Language("toml") @Nullable String after)
    • pipfile

      public static org.openrewrite.test.SourceSpecs pipfile(@Language("toml") @Nullable String before, @Language("toml") @Nullable String after, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.toml.tree.Toml.Document>> spec)
    • python

      public static org.openrewrite.test.SourceSpecs python(@Language("py") @Nullable String before)
    • python

      public static org.openrewrite.test.SourceSpecs python(@Language("py") @Nullable String before, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.python.tree.Py.CompilationUnit>> spec)
    • python

      public static org.openrewrite.test.SourceSpecs python(@Language("py") @Nullable String before, @Language("py") String after)
    • python

      public static org.openrewrite.test.SourceSpecs python(@Language("py") @Nullable String before, @Language("py") String after, Consumer<org.openrewrite.test.SourceSpec<org.openrewrite.python.tree.Py.CompilationUnit>> spec)