generated from kamangir/blue-plugin
-
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
18 changed files
with
127 additions
and
96 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
if not QGIS_is_live: | ||
from QGIS import QGIS | ||
|
||
Q = QGIS | ||
|
||
|
||
def clear(): | ||
QGIS.clear() | ||
|
||
|
||
def upload(object_name=""): | ||
QGIS.upload(object_name) | ||
def upload(what=""): | ||
QGIS.upload(what) |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
if not QGIS_is_live: | ||
from log import log | ||
from logger import log | ||
|
||
|
||
class BLUE_GEO_QGIS_APPLICATION(object): | ||
|
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,6 @@ | ||
import yaml | ||
|
||
|
||
def Q_load_yaml(filename): | ||
with open(filename, "r") as file: | ||
return yaml.safe_load(file) |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import os | ||
|
||
if not QGIS_is_live: | ||
from log import log_error | ||
from logger import log_error | ||
|
||
ABCLI_OBJECT_ROOT = "" | ||
|
||
|
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 |
---|---|---|
@@ -1,35 +1,42 @@ | ||
if not QGIS_is_live: | ||
from log import log, hr | ||
from blue_geo.QGIS.console.tests.test_QGIS import ( | ||
test_logging, | ||
test_QGIS_export, | ||
from logger import log, hr | ||
|
||
from tests.alias import test_aliases | ||
|
||
# from tests.layer import test_layer... | ||
from tests.logger import test_logging | ||
from tests.QGIS import ( | ||
test_QGIS_get_property, | ||
test_QGIS_logging, | ||
test_QGIS_open, | ||
test_QGIS_screenshot, | ||
test_QGIS_upload, | ||
) | ||
|
||
|
||
list_of_tests = [ | ||
test_aliases, | ||
test_logging, | ||
test_QGIS_export, | ||
test_QGIS_get_property, | ||
test_QGIS_logging, | ||
test_QGIS_open, | ||
test_QGIS_screenshot, | ||
test_QGIS_upload, | ||
] | ||
|
||
|
||
def test(deep: bool = False): | ||
log("testing ...") | ||
def Q_test(deep: bool = False): | ||
description: str = "{} test(s): {}".format( | ||
len(list_of_tests), | ||
", ".join([test_function.__name__ for test_function in list_of_tests]), | ||
) | ||
|
||
log(f"running {description} ...") | ||
hr() | ||
|
||
for test_function in list_of_tests: | ||
log(f"testing {test_function} ...") | ||
test_function(deep=deep) | ||
hr() | ||
|
||
log( | ||
"ran {} test(s): {}".format( | ||
len(list_of_tests), | ||
", ".join([test_function.__name__ for test_function in list_of_tests]), | ||
) | ||
) | ||
log(f"ran {description}.") |
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,12 @@ | ||
if not QGIS_is_live: | ||
from ..alias import Q, clear, upload | ||
from ..QGIS import ABCLI_QGIS | ||
|
||
|
||
def test_aliases(deep: bool = False): | ||
assert isinstance(Q, ABCLI_QGIS) | ||
Q.clear() | ||
|
||
clear() | ||
|
||
upload() |
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,8 @@ | ||
if not QGIS_is_live: | ||
from logger import log, log_error, verbose, hr | ||
from ..layer import layer | ||
|
||
|
||
def test_layer_properties( | ||
deep: bool = False, | ||
): ... |
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,17 @@ | ||
if not QGIS_is_live: | ||
from ..logger import hr, log, log_error, log_warning, verbose | ||
|
||
|
||
def test_logging(deep: bool = False): | ||
hr() | ||
hr(length=5) | ||
|
||
log("some message") | ||
log("some message", "some note") | ||
log("some message", "some note", "🔍") | ||
|
||
log_error("this is a test, don't panic! 😁") | ||
|
||
log_warning("this is a test, don't panic! 😁") | ||
|
||
assert isinstance(verbose, bool) |
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
Oops, something went wrong.