summaryrefslogtreecommitdiff
path: root/gerber/tests/test_cnc.py
blob: ace047e98caa08eaefc3d145b00aa6985ab765a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#! /usr/bin/env python
# -*- coding: utf-8 -*-

# Author: Hamilton Kibbe <ham@hamiltonkib.be>

from ..cnc import CncFile, FileSettings
from tests import *


def test_smoke_filesettings():
    """ Smoke test FileSettings class
    """
    fs = FileSettings()


def test_filesettings_defaults():
    """ Test FileSettings default values
    """
    fs = FileSettings()
    assert_equal(fs.format, (2, 5))
    assert_equal(fs.notation, 'absolute')
    assert_equal(fs.zero_suppression, 'trailing')
    assert_equal(fs.units, 'inch')


def test_filesettings_dict():
    """ Test FileSettings Dict
    """
    fs = FileSettings()
    assert_equal(fs['format'], (2, 5))
    assert_equal(fs['notation'], 'absolute')
    assert_equal(fs['zero_suppression'], 'trailing')
    assert_equal(fs['units'], 'inch')


def test_filesettings_assign():
    """ Test FileSettings attribute assignment
    """
    fs = FileSettings()
    fs.units = 'test'
    fs.notation = 'test'
    fs.zero_suppression = 'test'
    fs.format = 'test'
    assert_equal(fs.units, 'test')
    assert_equal(fs.notation, 'test')
    assert_equal(fs.zero_suppression, 'test')
    assert_equal(fs.format, 'test')

    def test_smoke_cncfile():
        pass