Exemplo n.º 1
0
    def test_storage_path(self):
        config = FileStorageConfiguration()
        engine = FileStorageEngine(config)
        engine.initialise()
        store = FilePatternNodeStore(engine)

        self.assertEquals('/tmp/nodes/pattern_nodes.conf',
                          store._get_storage_path())
        self.assertIsInstance(store.get_storage(), FileStoreConfiguration)
Exemplo n.º 2
0
    def test_load_variables(self):
        config = FileStorageConfiguration()
        config._pattern_nodes_storage = FileStoreConfiguration(file=os.path.dirname(__file__) + os.sep + "data" + os.sep + "nodes" + os.sep + "pattern_nodes.conf", format="text", encoding="utf-8", delete_on_start=False)
        engine = FileStorageEngine(config)
        engine.initialise()
        store = FilePatternNodeStore(engine)

        collection = PatternNodeFactory()
        store.load(collection)

        self.assertEqual(12, len(collection.nodes))
        self.assertTrue(collection.exists("zeroormore"))
Exemplo n.º 3
0
 def pattern_nodes_store(self):
     return FilePatternNodeStore(self)
Exemplo n.º 4
0
 def test_initialise(self):
     config = FileStorageConfiguration()
     engine = FileStorageEngine(config)
     engine.initialise()
     store = FilePatternNodeStore(engine)
     self.assertEqual(store.storage_engine, engine)