Skip to content

Commit

Permalink
Add Non-Ascii file with additional test
Browse files Browse the repository at this point in the history
  • Loading branch information
Syres916 authored Dec 30, 2024
1 parent e977eb4 commit ea47081
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Mod/TechDraw/TDTest/DrawViewSymbolTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,25 @@ def testMakeSymbol(self):

self.assertTrue("Up-to-date" in sym.State)

def testNonAsciiSymbol(self):
"""Tests if a Non-Ascii symbol can be added to page"""
print("Running Non Ascii Symbol Test")
sym = FreeCAD.ActiveDocument.addObject("TechDraw::DrawViewSymbol", "NonAsciiSymbol")
path = os.path.dirname(os.path.abspath(__file__))
symbolFileSpec = path + "/TestNonAsciiSymbol.svg"
f = open(symbolFileSpec, "r")
svg = f.read()
f.close()
sym.Symbol = svg
self.page.addView(sym)
sym.X = 220.0
sym.Y = 150.0

FreeCAD.ActiveDocument.recompute()

self.assertTrue("Up-to-date" in sym.State)



if __name__ == "__main__":
unittest.main()
23 changes: 23 additions & 0 deletions src/Mod/TechDraw/TDTest/TestNonAsciiSymbol.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ea47081

Please sign in to comment.