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)
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)))
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'], )
def setUp(self): #self.settings_dict = copy.deepcopy(self.BASE_SETTINGS) self.finder = OpenTSDBFinder('http://localhost:4242/api/v1', 1) cache.clear()