Commits

Evgeniy Tatarkin committed bd5b37c

add test for core.item

  • Participants
  • Parent commits b764a6b

Comments (0)

Files changed (1)

File tests/test_item.py

+from nose.tools import assert_equal
+from pomp.core.item import Item, Field
+
+
+def test_item():
+    class TItem(Item):
+        f1 = Field()
+        f2 = Field()
+        f3 = Field()
+
+    i = TItem()
+    assert_equal(['f1', 'f2', 'f3'], i.keys())
+
+    i.f1 = 1
+    i.f3 = 3
+    assert_equal([1, None, 3], i.values())