-
Notifications
You must be signed in to change notification settings - Fork 3
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
Showing
4 changed files
with
99 additions
and
11 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
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
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
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,45 @@ | ||
from pytion.models import * | ||
|
||
|
||
class TestProperty: | ||
def test_create(self): | ||
p = Property.create(type_="multi_select", name="multiselected") | ||
p.get() | ||
assert p.id is None | ||
assert p.type == "multi_select" | ||
assert p.to_delete is False | ||
|
||
def test_create__to_rename(self): | ||
p = Property.create(name="renamed") | ||
p.get() | ||
assert p.id is None | ||
assert p.type == "" | ||
assert p.name == "renamed" | ||
assert p.to_delete is False | ||
|
||
def test_create__to_delete(self): | ||
p = Property.create(type_=None) | ||
p.get() | ||
assert p.id is None | ||
assert p.type is None | ||
assert p.to_delete is True | ||
|
||
def test_create__relation_single(self): | ||
p = Property.create("relation", single_property="878d628488d94894ab14f9b872cd6870") | ||
p.get() | ||
assert p.id is None | ||
assert p.type == "relation" | ||
assert p.to_delete is False | ||
assert isinstance(p.relation, LinkTo) | ||
assert p.relation.uri == "databases" | ||
assert p.subtype == "single_property" | ||
|
||
def test_create__relation_dual(self): | ||
p = Property.create("relation", dual_property="878d628488d94894ab14f9b872cd6870") | ||
p.get() | ||
assert p.id is None | ||
assert p.type == "relation" | ||
assert p.to_delete is False | ||
assert isinstance(p.relation, LinkTo) | ||
assert p.relation.uri == "databases" | ||
assert p.subtype == "dual_property" |