Ejemplo n.º 1
0
    def test_finder_settings(self):
        '''
        Test that the finder can default to Django settings.
        '''

        finder = OpenTSDBFinder()
        self.assertEqual(finder.opentsdb_uri, 'http://localhost:9999')
        self.assertEqual(finder.opentsdb_tree, 999)
Ejemplo n.º 2
0
    def test_finder_missing_branch(self):
        '''
        Test that the finder can deal with a missing branch.
        '''

        finder = OpenTSDBFinder('http://localhost:4242/api/v1/', 3)

        with self.assertRaises(ValueError):
            nodes = list(finder.find_nodes(query=FindQuery('*', None, None)))
Ejemplo n.º 3
0
    def test_finder_nested_dotted_nodes(self):
        '''
        Test that the finder can deal with nested nodes with dots
        (Since OpenTSDB allows that).
        '''

        finder = OpenTSDBFinder('http://localhost:4242/api/v1/', 2)

        nodes = list(finder.find_nodes(query=FindQuery('*.*', None, None)))
        self.assertEqual(
            [node.name for node in nodes],
            ['leaf.with.dots'],
        )
Ejemplo n.º 4
0
 def setUp(self):
     #self.settings_dict = copy.deepcopy(self.BASE_SETTINGS)
     self.finder = OpenTSDBFinder('http://localhost:4242/api/v1', 1)
     cache.clear()