-
Notifications
You must be signed in to change notification settings - Fork 0
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
2 changed files
with
28 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import pytest | ||
from htag import Tag | ||
from htagweb.fqn import findfqn | ||
|
||
from examples import simple,main | ||
|
||
class App(Tag.div): | ||
pass | ||
|
||
def test_fqn(): | ||
assert findfqn(App) == "test_fqn.App" # not "__main__.App" !!!!! | ||
|
||
def test_fqn2(): | ||
assert findfqn("test_fqn.App") == "test_fqn.App" | ||
|
||
def test_fqn3(): | ||
assert findfqn("test_fqn:App") == "test_fqn.App" | ||
|
||
def test_fqn4(): | ||
assert findfqn(simple) == "examples.simple.App" | ||
|
||
def test_module_without_App(): | ||
with pytest.raises(Exception): # Exception: module should contains a 'App' (htag.Tag class) | ||
findfqn(main) | ||
|
||
def test_bad_fqn(): | ||
with pytest.raises(Exception): # Exception: ...is not a 'full qualified name' | ||
findfqn("main") |