File: test_type.py

package info (click to toggle)
python-admesh 0.98.9-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 244 kB
  • sloc: python: 331; sh: 97; makefile: 4
file content (18 lines) | stat: -rw-r--r-- 623 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# -*- coding: utf-8 -*-
from admesh import Stl
from utils import asset


class TestType(object):
    '''Tests for the type recognition'''
    def test_ascii_is_ascii(self):
        '''Tests if loaded ASCII file is recognized as ASCII'''
        stl = Stl(asset('block.stl'))
        assert stl.stats['type'] == Stl.ASCII

    def test_saved_binary_is_binary(self):
        '''Tests if saved binary file is identical to the loaded one'''
        stl1 = Stl(asset('block.stl'))
        stl1.write_binary(asset('block_binary.stl'))
        stl2 = Stl(asset('block_binary.stl'))
        assert stl2.stats['type'] == Stl.BINARY