-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test coverage for vbml.Component
- Loading branch information
Showing
1 changed file
with
40 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,40 @@ | ||
from vesta.vbml import Component | ||
|
||
|
||
class TestComponent: | ||
def test_template(self): | ||
assert Component("template").asdict() == {"template": "template"} | ||
|
||
def test_style(self): | ||
assert Component("template", style={}).asdict() == {"template": "template"} | ||
assert Component( | ||
"template", | ||
style={"height": 4, "width": 10, "justify": "left", "align": "top"}, | ||
).asdict() == { | ||
"template": "template", | ||
"style": {"height": 4, "width": 10, "justify": "left", "align": "top"}, | ||
} | ||
|
||
def test_height(self): | ||
assert Component("template", height=4).asdict() == { | ||
"template": "template", | ||
"style": {"height": 4}, | ||
} | ||
|
||
def test_width(self): | ||
assert Component("template", width=10).asdict() == { | ||
"template": "template", | ||
"style": {"width": 10}, | ||
} | ||
|
||
def test_justify(self): | ||
assert Component("template", justify="left").asdict() == { | ||
"template": "template", | ||
"style": {"justify": "left"}, | ||
} | ||
|
||
def test_align(self): | ||
assert Component("template", align="top").asdict() == { | ||
"template": "template", | ||
"style": {"align": "top"}, | ||
} |