mirror of
https://git.mirrors.martin98.com/https://github.com/petaflot/pygcode
synced 2025-06-04 11:25:20 +08:00
21 lines
621 B
Python
21 lines
621 B
Python
import sys
|
|
import os
|
|
import inspect
|
|
|
|
import unittest
|
|
|
|
# Units Under Test
|
|
_this_path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
|
|
sys.path.insert(0, os.path.join(_this_path, '..'))
|
|
from pygcode.file import parse, GCodeFile
|
|
|
|
class FileParseTest(unittest.TestCase):
|
|
FILENAME = 'test-files/vertical-slot.ngc'
|
|
|
|
def test_parser(self):
|
|
file = parse(self.FILENAME)
|
|
self.assertEqual(len(file.lines), 26)
|
|
# FIXME: just verifying content visually
|
|
for line in file.lines:
|
|
print(' '.join(["%s%s" % (w.letter, w.value_str) for w in line.block.words]))
|