Skip to content

Commit

Permalink
Added test case to determine directory layout.
Browse files Browse the repository at this point in the history
  • Loading branch information
mlampert committed Jan 27, 2021
1 parent f26e631 commit 4f0f9e7
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Mod/Path/PathTests/TestPathToolBit.py
Expand Up @@ -22,6 +22,7 @@

import PathScripts.PathToolBit as PathToolBit
import PathTests.PathTestUtils as PathTestUtils
import glob
import os

TestToolDir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Tools')
Expand All @@ -40,8 +41,25 @@ def testToolBit(path = TestToolDir, name = TestToolBitName):
def testToolLibrary(path = TestToolDir, name = TestToolLibraryName):
return os.path.join(path, 'Library', name)

def printTree(path, indent):
print("{} {}".format(indent, os.path.basename(path)))
if os.path.isdir(path):
if os.path.basename(path).startswith('__'):
print("{} ...".format(indent))
else:
for foo in sorted(glob.glob(os.path.join(path, '*'))):
printTree(foo, "{} ".format(indent))

class TestPathToolBit(PathTestUtils.PathTestBase):

def test(self):
'''Log test setup'''
print()
print("realpath : {}".format(os.path.realpath(__file__)))
print(" Tools : {}".format(TestToolDir))
print(" dir : {}".format(os.path.dirname(os.path.realpath(__file__))))
printTree(os.path.dirname(os.path.realpath(__file__)), " :")

def test00(self):
'''Find a tool shape from file name'''
path = PathToolBit.findToolShape('endmill.fcstd')
Expand Down

0 comments on commit 4f0f9e7

Please sign in to comment.