Skip to content

Commit

Permalink
Add BlockMeta
Browse files Browse the repository at this point in the history
Currently derives Meta without overriding anything, but is registered
under its own type id.
  • Loading branch information
c-mita committed Jun 30, 2016
1 parent c7acd01 commit 9425bc5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions malcolm/core/blockmeta.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from malcolm.core.meta import Meta
from malcolm.core.serializable import Serializable

@Serializable.register("malcolm:core/BlockMeta:1.0")
class BlockMeta(Meta):
pass
15 changes: 15 additions & 0 deletions tests/test_core/test_blockmeta.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import os
import sys
import unittest
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import setup_malcolm_paths

from malcolm.core.blockmeta import BlockMeta

class TestBlockMeta(unittest.TestCase):
def test_registered(self):
block_meta = BlockMeta("name", "desc")
self.assertEqual("malcolm:core/BlockMeta:1.0", block_meta.typeid)

if __name__ == "__main__":
unittest.main()

0 comments on commit 9425bc5

Please sign in to comment.