Added support for relative/absolute path mgmt for stored files.

This commit is contained in:
Markus Lampert
2019-11-09 19:57:58 -08:00
parent a2935d5ff0
commit c6f14b9836
16 changed files with 94 additions and 45 deletions

View File

@@ -43,3 +43,18 @@ class TestPathToolBit(PathTestUtils.PathTestBase):
self.assertNotEqual(path, '/this/is/unlikely/a/valid/path/v-bit.fcstd')
def test10(self):
'''find the relative path of a tool bit'''
shape = 'endmill-straight.fcstd'
path = PathToolBit.findShape(shape)
self.assertIsNot(path, None)
self.assertGreater(len(path), len(shape))
rel = PathToolBit.findRelativePathShape(path)
self.assertEqual(rel, shape)
def test11(self):
'''store full path if relative path isn't found'''
path = '/this/is/unlikely/a/valid/path/v-bit.fcstd'
rel = PathToolBit.findRelativePathShape(path)
self.assertEqual(rel, path)