MCPcopy Create free account
hub / github.com/dagger/dagger / TestNameConflicts

Method TestNameConflicts

core/integration/module_python_test.go:1790–1812  ·  view source on GitHub ↗
(ctx context.Context, t *testctx.T)

Source from the content-addressed store, hash-verified

1788}
1789
1790func (PythonSuite) TestNameConflicts(ctx context.Context, t *testctx.T) {
1791 c := connect(ctx, t)
1792
1793 modGen := pythonModInit(t, c, `
1794 from dagger import field, function, object_type
1795
1796 @object_type
1797 class Test:
1798 from_: str = field(default="")
1799
1800 @function
1801 def pass_(self, import_: str = "") -> str:
1802 return import_
1803 `)
1804
1805 out, err := modGen.With(daggerCall("--from=foo", "from")).Stdout(ctx)
1806 require.NoError(t, err)
1807 require.Equal(t, "foo", out)
1808
1809 out, err = modGen.With(daggerCall("pass", "--import=bar")).Stdout(ctx)
1810 require.NoError(t, err)
1811 require.Equal(t, "bar", out)
1812}
1813
1814func (PythonSuite) TestNameOverrides(ctx context.Context, t *testctx.T) {
1815 c := connect(ctx, t)

Callers

nothing calls this directly

Calls 6

pythonModInitFunction · 0.85
daggerCallFunction · 0.85
connectFunction · 0.70
EqualMethod · 0.65
StdoutMethod · 0.45
WithMethod · 0.45

Tested by

no test coverage detected