Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for viewController.createLines()
Lines can be successfully created. They are added to a, during runtime, created group called "BCF-X" where X is some random number between 0 and 5000.
- Loading branch information
1 parent
64d381c
commit 1910afd
Showing
3 changed files
with
43 additions
and
10 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 |
---|---|---|
@@ -1,15 +1,46 @@ | ||
def setupBCFFile(fileName, testFileDir, topicDir, testBCFName): | ||
import sys | ||
import os | ||
if __name__ == "__main__": | ||
sys.path.insert(0, "../") | ||
sys.path.append("../../env/lib/python3.7/site-packages") | ||
FreeCAD.open(u"../../bcf-examples/clippingPlane_bernd/bcfexample1.FCStd") | ||
|
||
import util | ||
|
||
import programmaticInterface as pI | ||
import frontend.viewController as vC | ||
|
||
|
||
def setupBCFFile(testFile, testFileDir, topicDir, testBCFName): | ||
|
||
cmd = "cp {}/{} {}/{}/viewpoint.bcfv".format(testFileDir, testFile, | ||
testFileDir, testTopicDir) | ||
project.debug("Executing: {}".format(cmd)) | ||
testFileDir, topicDir) | ||
print("Executing: {}".format(cmd)) | ||
os.system(cmd) | ||
|
||
cmd = "cd ./viewController-tests && zip -q {} {}/markup.bcf".format(testBCFName, | ||
cmd = "cd ./{} && zip -q {} {}/viewpoint.bcfv".format(testFileDir, testBCFName, | ||
topicDir) | ||
project.debug("Executing: {}".format(cmd)) | ||
print("Executing: {}".format(cmd)) | ||
os.system(cmd) | ||
|
||
return os.path.join(testFileDir, testBCFName) | ||
|
||
|
||
def test_letLinesDraw(): | ||
|
||
topics = [ topic[1] for topic in pI.getTopics() ] | ||
viewpoints = [ vp[1] for vp in pI.getViewpoints(topics[0]) ] | ||
vC.createLines(viewpoints[0].lines) | ||
|
||
|
||
|
||
#if __name__ == "__main__": | ||
testFileDir = "viewController-tests" | ||
testBCFFile = "bcfexmple_bernd.bcf" | ||
|
||
setupBCFFile("viewpoint_with_lines.bcfv", "viewController-tests", | ||
"d7301aa6-3533-4031-b209-9e1c701802f5", "bcfexmple_bernd.bcf") | ||
pI.openProject("./{}/{}".format(testFileDir, testBCFFile)) | ||
|
||
test_letLinesDraw() | ||
|
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