File: TestGCodeFormat.py

package info (click to toggle)
libcharon 5.0.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 576 kB
  • sloc: python: 1,575; sh: 388; makefile: 3
file content (21 lines) | stat: -rw-r--r-- 713 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Copyright (c) 2018 Ultimaker B.V.
# Charon is released under the terms of the LGPLv3 or higher.
import os

from Charon.VirtualFile import VirtualFile


def test_GCodeReader():
    f = VirtualFile()
    f.open(os.path.join(os.path.dirname(__file__), "resources", "um3.gcode"))
    assert f.getData("/metadata")["/metadata/toolpath/default/flavor"] == "Griffin"
    assert b"M104" in f.getStream("/toolpath").read()
    f.close()


def test_GCodeGzReader():
    f = VirtualFile()
    f.open(os.path.join(os.path.dirname(__file__), "resources", "um3.gcode.gz"))
    assert f.getData("/metadata")["/metadata/toolpath/default/flavor"] == "Griffin"
    assert b"M104" in f.getStream("/toolpath").read()
    f.close()