This commit is contained in:
parent
4759bdcd33
commit
29e48e284c
3 changed files with 13 additions and 24 deletions
|
@ -1,13 +1,16 @@
|
|||
import pytest
|
||||
from os import getcwd
|
||||
from os.path import join
|
||||
from tempfile import TemporaryDirectory
|
||||
from LogarithmPlotter.util import config
|
||||
|
||||
pwd = getcwd()
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def resource():
|
||||
def temporary():
|
||||
directory = TemporaryDirectory()
|
||||
config.CONFIG_PATH = join(directory.name, "config.json")
|
||||
tmpfile = join(directory.name, 'graph.png')
|
||||
tmpfile = join(directory.name, "graph.png")
|
||||
yield tmpfile
|
||||
directory.cleanup()
|
||||
directory.cleanup()
|
||||
|
|
|
@ -13,6 +13,7 @@ class TestPyJS:
|
|||
def test_set(self):
|
||||
obj.num1 = 2
|
||||
obj.num2 = QJSValue(2)
|
||||
obj.num3 = PyJSValue(QJSValue(2))
|
||||
with pytest.raises(InvalidAttributeValueException):
|
||||
obj.num3 = object()
|
||||
|
||||
|
@ -20,6 +21,7 @@ class TestPyJS:
|
|||
obj.num = QJSValue(2)
|
||||
assert obj.num == 2
|
||||
assert obj.num == QJSValue(2)
|
||||
assert obj.num == PyJSValue(QJSValue(2))
|
||||
assert obj.num != object()
|
||||
|
||||
def test_function(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue