summaryrefslogtreecommitdiff
path: root/gerber/tests/test_cam.py
diff options
context:
space:
mode:
Diffstat (limited to 'gerber/tests/test_cam.py')
-rw-r--r--gerber/tests/test_cam.py52
1 files changed, 35 insertions, 17 deletions
diff --git a/gerber/tests/test_cam.py b/gerber/tests/test_cam.py
index 4af1984..ce4ec44 100644
--- a/gerber/tests/test_cam.py
+++ b/gerber/tests/test_cam.py
@@ -7,12 +7,6 @@ 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
"""
@@ -37,14 +31,38 @@ 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
+ fs.units = 'test1'
+ fs.notation = 'test2'
+ fs.zero_suppression = 'test3'
+ fs.format = 'test4'
+ assert_equal(fs.units, 'test1')
+ assert_equal(fs.notation, 'test2')
+ assert_equal(fs.zero_suppression, 'test3')
+ assert_equal(fs.format, 'test4')
+
+
+def test_filesettings_dict_assign():
+ """ Test FileSettings dict-style attribute assignment
+ """
+ fs = FileSettings()
+ fs['units'] = 'metric'
+ fs['notation'] = 'incremental'
+ fs['zero_suppression'] = 'leading'
+ fs['format'] = (1, 2)
+ assert_equal(fs.units, 'metric')
+ assert_equal(fs.notation, 'incremental')
+ assert_equal(fs.zero_suppression, 'leading')
+ assert_equal(fs.format, (1, 2))
+
+def test_camfile_init():
+ """ Smoke test CamFile test
+ """
+ cf = CamFile()
+
+def test_camfile_settings():
+ """ Test CamFile Default Settings
+ """
+ cf = CamFile()
+ assert_equal(cf.settings, FileSettings())
+
+ \ No newline at end of file