- I've finally run the tests with OK result (56 tests in 102.937 sec)
- I had to play with module imports as they created a lot of error in the tests although in reality the program worked OK. - I've fixed some mistakes in TcL commands (they were testing isinstance against the like of Geometry instead of FlatCAMGeometry) - I've had to add some fixes in ObjectCollections.py (error on create_index() method but Marco already fixed this in the checkbox in project tab pull request and knew about this. - Although at some point the tests run fine, I've made some checkings on my own over the Tcl commands and discovered errors which I fixed as mentioned above. - conclusion is that tests are just a must and do not cover everything (like saving projects which at some point by juggling with imports I braked and tests were 100% OK)
This commit is contained in:
@@ -5,6 +5,7 @@ import abc
|
||||
import collections
|
||||
from PyQt4 import QtCore
|
||||
from contextlib import contextmanager
|
||||
from FlatCAMObj import FlatCAMGerber, FlatCAMExcellon, FlatCAMGeometry, FlatCAMCNCjob, FlatCAMObj
|
||||
|
||||
|
||||
class TclCommand(object):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommand
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandAddCircle(TclCommand):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandAddPolygon(TclCommandSignaled):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandAddPolyline(TclCommandSignaled):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandAddRectangle(TclCommandSignaled):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandAlignDrill(TclCommandSignaled):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandAlignDrillGrid(TclCommandSignaled):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandCncjob(TclCommandSignaled):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommand
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandCutout(TclCommand):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommand
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandDelete(TclCommand):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandDrillcncjob(TclCommandSignaled):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandExportGcode(TclCommandSignaled):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommand
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandExportSVG(TclCommand):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandExteriors(TclCommandSignaled):
|
||||
@@ -54,7 +53,7 @@ class TclCommandExteriors(TclCommandSignaled):
|
||||
if obj is None:
|
||||
self.raise_tcl_error("Object not found: %s" % name)
|
||||
|
||||
if not isinstance(obj, Geometry):
|
||||
if not isinstance(obj, FlatCAMGeometry):
|
||||
self.raise_tcl_error('Expected Geometry, got %s %s.' % (name, type(obj)))
|
||||
|
||||
def geo_init(geo_obj, app_obj):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandGeoCutout(TclCommandSignaled):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommand
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandGeoUnion(TclCommand):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommand
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandGetNames(TclCommand):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommand
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandGetSys(TclCommand):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandImportSvg(TclCommandSignaled):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandInteriors(TclCommandSignaled):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandIsolate(TclCommandSignaled):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommand
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandJoinExcellon(TclCommand):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommand
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandJoinGeometry(TclCommand):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandMillHoles(TclCommandSignaled):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandMirror(TclCommandSignaled):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommand
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandNew(TclCommand):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandNewGeometry(TclCommandSignaled):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommand
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandOffset(TclCommand):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandOpenExcellon(TclCommandSignaled):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandOpenGCode(TclCommandSignaled):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandOpenGerber(TclCommandSignaled):
|
||||
@@ -48,7 +47,7 @@ class TclCommandOpenGerber(TclCommandSignaled):
|
||||
# How the object should be initialized
|
||||
def obj_init(gerber_obj, app_obj):
|
||||
|
||||
if not isinstance(gerber_obj, Geometry):
|
||||
if not isinstance(gerber_obj, FlatCAMGerber):
|
||||
self.raise_tcl_error('Expected FlatCAMGerber, got %s %s.' % (outname, type(gerber_obj)))
|
||||
|
||||
# Opening the file happens here
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandOpenProject(TclCommandSignaled):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandOptions(TclCommandSignaled):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandPaint(TclCommandSignaled):
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
from ObjectCollection import *
|
||||
from copy import copy,deepcopy
|
||||
|
||||
from tclCommands.TclCommand import TclCommand
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandPanelize(TclCommand):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommand
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandPlot(TclCommand):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandSaveProject(TclCommandSignaled):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommand
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandScale(TclCommand):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommand
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandSetActive(TclCommand):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommand
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandSetSys(TclCommand):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandSubtractPoly(TclCommandSignaled):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandSubtractRectangle(TclCommandSignaled):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommand
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandVersion(TclCommand):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from ObjectCollection import *
|
||||
from tclCommands.TclCommand import TclCommandSignaled
|
||||
from tclCommands.TclCommand import *
|
||||
|
||||
|
||||
class TclCommandWriteGCode(TclCommandSignaled):
|
||||
|
||||
Reference in New Issue
Block a user