Commit 46e73026 authored by Yori 'AGy' Fournier's avatar Yori 'AGy' Fournier
Browse files

test for MyFig are now done! see test307, test308, test309

parent fc1939d0
......@@ -133,7 +133,8 @@ from .test import myTest
# import the tests
from .test import test100
from .test import test200, test201, test202
from .test import test300, test301, test302, test303, test304, test305, test306
from .test import test300, test301, test302, test303, test304, test305
from .test import test306, test307, test308, test309
from .test import test400, test401, test402, test403
from .test import test600
......@@ -141,7 +142,7 @@ from .test import test600
testList = [test100,
test200, test201, test202,
test300, test301, test302, test303, test304, test305,
test306,
test306, test307, test308, test309,
test400, test401, test402,
test600,
]
......@@ -349,7 +349,7 @@ def test305(debug):
return(status)
# TEST 306: Test MyFig::print2file (EXPECTED: True)
# TEST 3.06: Test MyFig::print2file (EXPECTED: True)
def test306(debug):
if os.path.exists("./myplotlib/img/test306.png"):
......@@ -375,6 +375,84 @@ def test306(debug):
return(status)
# TEST 3.07: test MyFig::printDebug
def test307(debug):
fig = MyFig()
fig.printDebug()
return(True)
# TEST 3.08: test MyFig::plot
def test308(debug):
fig = MyFig(inputarg='Non-Existing-Data')
status = fig.plot()
if(not status):
status = True
else:
status = False
if(debug):
print(DBUG + "test without data: " + str(status))
G_RAWDATAS.update({'data': MyData()})
G_RAWDATAS['data'].data = [1, -1, -1, 1]
fig.update(inputarg='data')
fig.plot()
if len(fig.get_axes()) > 0:
status = status and True
else:
status = False
if(debug):
print(DBUG + "creation of axis: " + str(status))
if((fig.get_axes()[0].lines[0]._x == [1, -1]).all()):
status = status and True
else:
status = False
if(debug):
print(DBUG + "data to the axis: " + str(status))
return(status)
# TEST 3.09: test MyFig::__init__
def test309(debug):
status = True
fig = MyFig(fignum=-12, inputarg='dummy', reformat=True, debug=True, formatted=True)
if hasattr(fig, 'keywords'):
if fig.keywords['fignum'] != -12:
status = False
if fig.keywords['inputarg'] != 'dummy':
status = False
if(not (fig.keywords['debug'] and fig.keywords['reformat'] and fig.keywords['formatted'])):
status = False
else:
status = False
if not hasattr(fig, 'FIGSIZE'):
status = False
if not hasattr(fig, 'boundedToWin'):
status = False
return(status)
# TEST 4.00: test MyWin (EXPECTED: TRUE)
def test400(debug):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment