-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6aac60
commit 9f3eee8
Showing
11 changed files
with
680 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import pytest | ||
|
||
from pyatlan.model.assets import AnaplanApp | ||
from tests.unit.model.constants import ( | ||
ANAPLAN_APP_NAME, | ||
ANAPLAN_APP_QUALIFIED_NAME, | ||
ANAPLAN_CONNECTION_QUALIFIED_NAME, | ||
ANAPLAN_CONNECTOR_TYPE, | ||
) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"name, connection_qualified_name, message", | ||
[ | ||
(None, "connection/name", "name is required"), | ||
(ANAPLAN_APP_NAME, None, "connection_qualified_name is required"), | ||
], | ||
) | ||
def test_create_with_missing_parameters_raise_value_error( | ||
name: str, connection_qualified_name: str, message: str | ||
): | ||
with pytest.raises(ValueError, match=message): | ||
AnaplanApp.create( | ||
name=name, connection_qualified_name=connection_qualified_name | ||
) | ||
|
||
|
||
def test_create(): | ||
sut = AnaplanApp.creator( | ||
name=ANAPLAN_APP_NAME, | ||
connection_qualified_name=ANAPLAN_CONNECTION_QUALIFIED_NAME, | ||
) | ||
|
||
assert sut.name == ANAPLAN_APP_NAME | ||
assert sut.connection_qualified_name == ANAPLAN_CONNECTION_QUALIFIED_NAME | ||
assert sut.qualified_name == ANAPLAN_APP_QUALIFIED_NAME | ||
assert sut.connector_name == ANAPLAN_CONNECTOR_TYPE | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"qualified_name, name, message", | ||
[ | ||
(None, ANAPLAN_CONNECTION_QUALIFIED_NAME, "qualified_name is required"), | ||
(ANAPLAN_APP_NAME, None, "name is required"), | ||
], | ||
) | ||
def test_create_for_modification_with_invalid_parameter_raises_value_error( | ||
qualified_name: str, name: str, message: str | ||
): | ||
with pytest.raises(ValueError, match=message): | ||
AnaplanApp.create_for_modification(qualified_name=qualified_name, name=name) | ||
|
||
|
||
def test_create_for_modification(): | ||
sut = AnaplanApp.create_for_modification( | ||
qualified_name=ANAPLAN_APP_QUALIFIED_NAME, name=ANAPLAN_APP_NAME | ||
) | ||
|
||
assert sut.qualified_name == ANAPLAN_APP_QUALIFIED_NAME | ||
assert sut.name == ANAPLAN_APP_NAME | ||
|
||
|
||
def test_trim_to_required(): | ||
sut = AnaplanApp.create_for_modification( | ||
name=ANAPLAN_APP_NAME, qualified_name=ANAPLAN_APP_QUALIFIED_NAME | ||
).trim_to_required() | ||
|
||
assert sut.name == ANAPLAN_APP_NAME | ||
assert sut.qualified_name == ANAPLAN_APP_QUALIFIED_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import pytest | ||
|
||
from pyatlan.model.assets import AnaplanDimension | ||
from tests.unit.model.constants import ( | ||
ANAPLAN_CONNECTION_QUALIFIED_NAME, | ||
ANAPLAN_CONNECTOR_TYPE, | ||
ANAPLAN_DIMENSION_NAME, | ||
ANAPLAN_DIMENSION_QUALIFIED_NAME, | ||
ANAPLAN_MODEL_QUALIFIED_NAME, | ||
) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"name, connection_qualified_name, message", | ||
[ | ||
(None, "connection/name", "name is required"), | ||
(ANAPLAN_DIMENSION_NAME, None, "connection_qualified_name is required"), | ||
], | ||
) | ||
def test_create_with_missing_parameters_raise_value_error( | ||
name: str, connection_qualified_name: str, message: str | ||
): | ||
with pytest.raises(ValueError, match=message): | ||
AnaplanDimension.create( | ||
name=name, connection_qualified_name=connection_qualified_name | ||
) | ||
|
||
|
||
def test_create(): | ||
sut = AnaplanDimension.creator( | ||
name=ANAPLAN_DIMENSION_NAME, | ||
model_qualified_name=ANAPLAN_MODEL_QUALIFIED_NAME, | ||
) | ||
|
||
assert sut.name == ANAPLAN_DIMENSION_NAME | ||
assert sut.connection_qualified_name == ANAPLAN_CONNECTION_QUALIFIED_NAME | ||
assert sut.qualified_name == ANAPLAN_DIMENSION_QUALIFIED_NAME | ||
assert sut.connector_name == ANAPLAN_CONNECTOR_TYPE | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"qualified_name, name, message", | ||
[ | ||
(None, ANAPLAN_MODEL_QUALIFIED_NAME, "qualified_name is required"), | ||
(ANAPLAN_DIMENSION_NAME, None, "name is required"), | ||
], | ||
) | ||
def test_create_for_modification_with_invalid_parameter_raises_value_error( | ||
qualified_name: str, name: str, message: str | ||
): | ||
with pytest.raises(ValueError, match=message): | ||
AnaplanDimension.create_for_modification( | ||
qualified_name=qualified_name, name=name | ||
) | ||
|
||
|
||
def test_create_for_modification(): | ||
sut = AnaplanDimension.create_for_modification( | ||
qualified_name=ANAPLAN_DIMENSION_QUALIFIED_NAME, name=ANAPLAN_DIMENSION_NAME | ||
) | ||
|
||
assert sut.qualified_name == ANAPLAN_DIMENSION_QUALIFIED_NAME | ||
assert sut.name == ANAPLAN_DIMENSION_NAME | ||
|
||
|
||
def test_trim_to_required(): | ||
sut = AnaplanDimension.create_for_modification( | ||
name=ANAPLAN_DIMENSION_NAME, qualified_name=ANAPLAN_DIMENSION_QUALIFIED_NAME | ||
).trim_to_required() | ||
|
||
assert sut.name == ANAPLAN_DIMENSION_NAME | ||
assert sut.qualified_name == ANAPLAN_DIMENSION_QUALIFIED_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import pytest | ||
|
||
from pyatlan.model.assets import AnaplanLineItem | ||
from tests.unit.model.constants import ( | ||
ANAPLAN_CONNECTION_QUALIFIED_NAME, | ||
ANAPLAN_CONNECTOR_TYPE, | ||
ANAPLAN_LINE_ITEM_NAME, | ||
ANAPLAN_LINE_ITEM_QUALIFIED_NAME, | ||
ANAPLAN_MODULE_QUALIFIED_NAME, | ||
) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"name, connection_qualified_name, message", | ||
[ | ||
(None, "connection/name", "name is required"), | ||
(ANAPLAN_LINE_ITEM_NAME, None, "connection_qualified_name is required"), | ||
], | ||
) | ||
def test_create_with_missing_parameters_raise_value_error( | ||
name: str, connection_qualified_name: str, message: str | ||
): | ||
with pytest.raises(ValueError, match=message): | ||
AnaplanLineItem.create( | ||
name=name, connection_qualified_name=connection_qualified_name | ||
) | ||
|
||
|
||
def test_create(): | ||
sut = AnaplanLineItem.creator( | ||
name=ANAPLAN_LINE_ITEM_NAME, | ||
module_qualified_name=ANAPLAN_MODULE_QUALIFIED_NAME, | ||
) | ||
|
||
assert sut.name == ANAPLAN_LINE_ITEM_NAME | ||
assert sut.connection_qualified_name == ANAPLAN_CONNECTION_QUALIFIED_NAME | ||
assert sut.qualified_name == ANAPLAN_LINE_ITEM_QUALIFIED_NAME | ||
assert sut.connector_name == ANAPLAN_CONNECTOR_TYPE | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"qualified_name, name, message", | ||
[ | ||
(None, ANAPLAN_MODULE_QUALIFIED_NAME, "qualified_name is required"), | ||
(ANAPLAN_LINE_ITEM_NAME, None, "name is required"), | ||
], | ||
) | ||
def test_create_for_modification_with_invalid_parameter_raises_value_error( | ||
qualified_name: str, name: str, message: str | ||
): | ||
with pytest.raises(ValueError, match=message): | ||
AnaplanLineItem.create_for_modification( | ||
qualified_name=qualified_name, name=name | ||
) | ||
|
||
|
||
def test_create_for_modification(): | ||
sut = AnaplanLineItem.create_for_modification( | ||
qualified_name=ANAPLAN_LINE_ITEM_QUALIFIED_NAME, name=ANAPLAN_LINE_ITEM_NAME | ||
) | ||
|
||
assert sut.qualified_name == ANAPLAN_LINE_ITEM_QUALIFIED_NAME | ||
assert sut.name == ANAPLAN_LINE_ITEM_NAME | ||
|
||
|
||
def test_trim_to_required(): | ||
sut = AnaplanLineItem.create_for_modification( | ||
name=ANAPLAN_LINE_ITEM_NAME, qualified_name=ANAPLAN_LINE_ITEM_QUALIFIED_NAME | ||
).trim_to_required() | ||
|
||
assert sut.name == ANAPLAN_LINE_ITEM_NAME | ||
assert sut.qualified_name == ANAPLAN_LINE_ITEM_QUALIFIED_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import pytest | ||
|
||
from pyatlan.model.assets import AnaplanList | ||
from tests.unit.model.constants import ( | ||
ANAPLAN_CONNECTION_QUALIFIED_NAME, | ||
ANAPLAN_CONNECTOR_TYPE, | ||
ANAPLAN_LIST_NAME, | ||
ANAPLAN_LIST_QUALIFIED_NAME, | ||
ANAPLAN_MODEL_QUALIFIED_NAME, | ||
) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"name, connection_qualified_name, message", | ||
[ | ||
(None, "connection/name", "name is required"), | ||
(ANAPLAN_LIST_NAME, None, "connection_qualified_name is required"), | ||
], | ||
) | ||
def test_create_with_missing_parameters_raise_value_error( | ||
name: str, connection_qualified_name: str, message: str | ||
): | ||
with pytest.raises(ValueError, match=message): | ||
AnaplanList.create( | ||
name=name, connection_qualified_name=connection_qualified_name | ||
) | ||
|
||
|
||
def test_create(): | ||
sut = AnaplanList.creator( | ||
name=ANAPLAN_LIST_NAME, | ||
model_qualified_name=ANAPLAN_MODEL_QUALIFIED_NAME, | ||
) | ||
|
||
assert sut.name == ANAPLAN_LIST_NAME | ||
assert sut.connection_qualified_name == ANAPLAN_CONNECTION_QUALIFIED_NAME | ||
assert sut.qualified_name == ANAPLAN_LIST_QUALIFIED_NAME | ||
assert sut.connector_name == ANAPLAN_CONNECTOR_TYPE | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"qualified_name, name, message", | ||
[ | ||
(None, ANAPLAN_MODEL_QUALIFIED_NAME, "qualified_name is required"), | ||
(ANAPLAN_LIST_NAME, None, "name is required"), | ||
], | ||
) | ||
def test_create_for_modification_with_invalid_parameter_raises_value_error( | ||
qualified_name: str, name: str, message: str | ||
): | ||
with pytest.raises(ValueError, match=message): | ||
AnaplanList.create_for_modification(qualified_name=qualified_name, name=name) | ||
|
||
|
||
def test_create_for_modification(): | ||
sut = AnaplanList.create_for_modification( | ||
qualified_name=ANAPLAN_LIST_QUALIFIED_NAME, name=ANAPLAN_LIST_NAME | ||
) | ||
|
||
assert sut.qualified_name == ANAPLAN_LIST_QUALIFIED_NAME | ||
assert sut.name == ANAPLAN_LIST_NAME | ||
|
||
|
||
def test_trim_to_required(): | ||
sut = AnaplanList.create_for_modification( | ||
name=ANAPLAN_LIST_NAME, qualified_name=ANAPLAN_LIST_QUALIFIED_NAME | ||
).trim_to_required() | ||
|
||
assert sut.name == ANAPLAN_LIST_NAME | ||
assert sut.qualified_name == ANAPLAN_LIST_QUALIFIED_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import pytest | ||
|
||
from pyatlan.model.assets import AnaplanModel | ||
from tests.unit.model.constants import ( | ||
ANAPLAN_CONNECTION_QUALIFIED_NAME, | ||
ANAPLAN_CONNECTOR_TYPE, | ||
ANAPLAN_MODEL_NAME, | ||
ANAPLAN_MODEL_QUALIFIED_NAME, | ||
ANAPLAN_WORKSPACE_QUALIFIED_NAME, | ||
) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"name, connection_qualified_name, message", | ||
[ | ||
(None, "connection/name", "name is required"), | ||
(ANAPLAN_MODEL_NAME, None, "connection_qualified_name is required"), | ||
], | ||
) | ||
def test_create_with_missing_parameters_raise_value_error( | ||
name: str, connection_qualified_name: str, message: str | ||
): | ||
with pytest.raises(ValueError, match=message): | ||
AnaplanModel.create( | ||
name=name, connection_qualified_name=connection_qualified_name | ||
) | ||
|
||
|
||
def test_create(): | ||
sut = AnaplanModel.creator( | ||
name=ANAPLAN_MODEL_NAME, | ||
workspace_qualified_name=ANAPLAN_WORKSPACE_QUALIFIED_NAME, | ||
) | ||
|
||
assert sut.name == ANAPLAN_MODEL_NAME | ||
assert sut.connection_qualified_name == ANAPLAN_CONNECTION_QUALIFIED_NAME | ||
assert sut.qualified_name == ANAPLAN_MODEL_QUALIFIED_NAME | ||
assert sut.connector_name == ANAPLAN_CONNECTOR_TYPE | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"qualified_name, name, message", | ||
[ | ||
(None, ANAPLAN_WORKSPACE_QUALIFIED_NAME, "qualified_name is required"), | ||
(ANAPLAN_MODEL_NAME, None, "name is required"), | ||
], | ||
) | ||
def test_create_for_modification_with_invalid_parameter_raises_value_error( | ||
qualified_name: str, name: str, message: str | ||
): | ||
with pytest.raises(ValueError, match=message): | ||
AnaplanModel.create_for_modification(qualified_name=qualified_name, name=name) | ||
|
||
|
||
def test_create_for_modification(): | ||
sut = AnaplanModel.create_for_modification( | ||
qualified_name=ANAPLAN_MODEL_QUALIFIED_NAME, name=ANAPLAN_MODEL_NAME | ||
) | ||
|
||
assert sut.qualified_name == ANAPLAN_MODEL_QUALIFIED_NAME | ||
assert sut.name == ANAPLAN_MODEL_NAME | ||
|
||
|
||
def test_trim_to_required(): | ||
sut = AnaplanModel.create_for_modification( | ||
name=ANAPLAN_MODEL_NAME, qualified_name=ANAPLAN_MODEL_QUALIFIED_NAME | ||
).trim_to_required() | ||
|
||
assert sut.name == ANAPLAN_MODEL_NAME | ||
assert sut.qualified_name == ANAPLAN_MODEL_QUALIFIED_NAME |
Oops, something went wrong.