Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create ProductInfo.for_testing(klass) factory #62

Closed
nfx opened this issue Mar 9, 2024 · 0 comments · Fixed by #63
Closed

Create ProductInfo.for_testing(klass) factory #62

nfx opened this issue Mar 9, 2024 · 0 comments · Fixed by #63

Comments

@nfx
Copy link
Collaborator

nfx commented Mar 9, 2024

at the moment, it's a bit cumbersome to do

        product_name = make_random(4)
        product_info = ProductInfo.from_class(WorkspaceConfig)
        product_info.product_name = lambda: product_name
nfx added a commit that referenced this issue Mar 9, 2024
When you're integration testing your [installations](#installation), you may want to have different [installation folders](#install-folder) for each test execution. `ProductInfo.for_testing(klass)` helps you with this:

```python
from ... import ConfigurationClass
from databricks.labs.blueprint.wheels import ProductInfo

first = ProductInfo.for_testing(ConfigurationClass)
second = ProductInfo.for_testing(ConfigurationClass)
assert first.product_name() != second.product_name()
```

Fix #62
nfx added a commit that referenced this issue Mar 9, 2024
When you're integration testing your [installations](#installation), you may want to have different [installation folders](#install-folder) for each test execution. `ProductInfo.for_testing(klass)` helps you with this:

```python
from ... import ConfigurationClass
from databricks.labs.blueprint.wheels import ProductInfo

first = ProductInfo.for_testing(ConfigurationClass)
second = ProductInfo.for_testing(ConfigurationClass)
assert first.product_name() != second.product_name()
```

Fix #62
nfx added a commit that referenced this issue Mar 9, 2024
When you're integration testing your [installations](#installation), you may want to have different [installation folders](#install-folder) for each test execution. `ProductInfo.for_testing(klass)` helps you with this:

```python
from ... import ConfigurationClass
from databricks.labs.blueprint.wheels import ProductInfo

first = ProductInfo.for_testing(ConfigurationClass)
second = ProductInfo.for_testing(ConfigurationClass)
assert first.product_name() != second.product_name()
```

Fix #62
@nfx nfx closed this as completed in #63 Mar 9, 2024
nfx added a commit that referenced this issue Mar 9, 2024
When you're integration testing your [installations](#installation), you
may want to have different [installation folders](#install-folder) for
each test execution. `ProductInfo.for_testing(klass)` helps you with
this:

```python
from ... import ConfigurationClass
from databricks.labs.blueprint.wheels import ProductInfo

first = ProductInfo.for_testing(ConfigurationClass)
second = ProductInfo.for_testing(ConfigurationClass)
assert first.product_name() != second.product_name()
```

Fix #62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant