summaryrefslogtreecommitdiff
path: root/gerber/tests/test_cam.py
diff options
context:
space:
mode:
authorHamilton Kibbe <ham@hamiltonkib.be>2014-10-13 12:38:57 -0400
committerHamilton Kibbe <ham@hamiltonkib.be>2014-10-13 12:38:57 -0400
commit6adcdbae5fc06959203761616e778ba4594475cc (patch)
tree1b878d7fe63645899a0d631849596b70bd002b07 /gerber/tests/test_cam.py
parent152fca07685d6f96f5e5bad723f1f62de99d8b7d (diff)
parent8c5c7ec8bbc8a074884ef04b566f9c0ecd6e78bb (diff)
downloadgerbonara-6adcdbae5fc06959203761616e778ba4594475cc.tar.gz
gerbonara-6adcdbae5fc06959203761616e778ba4594475cc.tar.bz2
gerbonara-6adcdbae5fc06959203761616e778ba4594475cc.zip
Merge branch 'master' of https://github.com/hamiltonkibbe/gerber-tools
Diffstat (limited to 'gerber/tests/test_cam.py')
-rw-r--r--gerber/tests/test_cam.py50
1 files changed, 50 insertions, 0 deletions
diff --git a/gerber/tests/test_cam.py b/gerber/tests/test_cam.py
new file mode 100644
index 0000000..4af1984
--- /dev/null
+++ b/gerber/tests/test_cam.py
@@ -0,0 +1,50 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+
+# Author: Hamilton Kibbe <ham@hamiltonkib.be>
+
+from ..cam import CamFile, 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_camfile():
+ cf = CamFile