""" Part of the bsie test suite. A copy of the license is provided with the project. Author: Matthias Baumgartner, 2022 """ # imports import os import unittest # bsie imports from bsie.utils import ns from bsie.utils.node import Node # objects to test from bsie.extractor.generic.stat import Stat ## code ## class TestConstant(unittest.TestCase): def test_extract(self): node = Node(ns.bsfs.Entity, '') # Blank node content = os.stat(__file__) ext = Stat() # baseline self.assertSetEqual(set(ext.extract(node, content, (ns.bse.filesize, ))), {(node, ns.bse.filesize, content.st_size)}) # predicates parameter is respected self.assertSetEqual(set(ext.extract(node, content, (ns.bse.filesize, ns.bse.foo))), {(node, ns.bse.filesize, content.st_size)}) self.assertSetEqual(set(ext.extract(node, content, (ns.bse.foo, ))), set()) # content variations self.assertSetEqual(set(ext.extract(node, None, (ns.bse.filesize, ))), set()) ## main ## if __name__ == '__main__': unittest.main() ## EOF ##