当前位置: 首页>>代码示例>>Python>>正文


Python test_logger.debug函数代码示例

本文整理汇总了Python中tests.test_logger.debug函数的典型用法代码示例。如果您正苦于以下问题:Python debug函数的具体用法?Python debug怎么用?Python debug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了debug函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_hamming_distance_multiple

    def test_hamming_distance_multiple(self):
        test_logger.debug("FindNearestTest - test_hamming_distance_multiple Starts")

        points = ["abcdef", "abcefg", "abcdeg"]
        point = "abcdef"
        find_nearest = FindNearest(points, point, HammingDistance, k=2)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals(['abcdef', 'abcdeg'], nearest)

        points = ["abcXdef", "abcXefg", "abcXdeg"]
        point = "abcdefg"
        find_nearest = FindNearest(points, point, HammingDistance, k=2)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals(['abcXefg', 'abcXdeg'], nearest)

        points = ["abcXdef", "abcXefg", "abcXdeg"]
        point = "1234567"
        find_nearest = FindNearest(points, point, HammingDistance, k=2)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals(['abcXdef', 'abcXdef'], nearest)

        points = ["abcXdef", "abcXefg", "abcXdeg"]
        point = "123456 "
        find_nearest = FindNearest(points, point, HammingDistance, k=2)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals(['abcXdef', 'abcXdef'], nearest)

        test_logger.debug("FindNearestTest - test_hamming_distance_multiple Ends")
开发者ID:RayleighChen,项目名称:similarityPy,代码行数:32,代码来源:hamming_distance_test.py

示例2: test_damerau_levenshtein_distance_multiple

    def test_damerau_levenshtein_distance_multiple(self):
        test_logger.debug("FindNearestTest - test_damerau_levenshtein_distance_multiple Starts")

        points = ["abcdef", "abcef", "abcde"]
        point = "abcdefg"
        find_nearest = FindNearest(points, point, DamerauLevenshteinDistance, k=2)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals(['abcdef', 'abcef'], nearest)

        points = ["abcXdef", "abcXef", "abcXde"]
        point = "abcdefg"
        find_nearest = FindNearest(points, point, DamerauLevenshteinDistance, k=2)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals(['abcXdef', 'abcXdef'], nearest)

        points = ["abcXdef", "abcXef", "abcXde"]
        point = "123456"
        find_nearest = FindNearest(points, point, DamerauLevenshteinDistance, k=2)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals(['abcXef', 'abcXef'], nearest)

        points = ["abcXdef", "abcXef", "abcXde"]
        point = "123456 "
        find_nearest = FindNearest(points, point, DamerauLevenshteinDistance, k=2)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals(['abcXdef', 'abcXdef'], nearest)

        test_logger.debug("FindNearestTest - test_damerau_levenshtein_distance_multiple Ends")
开发者ID:RayleighChen,项目名称:similarityPy,代码行数:32,代码来源:damerau_levenshtein_distance_test.py

示例3: test_correlation_distance

    def test_correlation_distance(self):
        test_logger.debug("FindNearestTest - test_correlation_distance Starts")

        points = [(2, 3), (3, 4), (4, 5)]
        point = (2, 1)
        find_nearest = FindNearest(points, point, CorrelationDistance)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals((2, 3), nearest)

        points = [(2, 3), (3, 4), (4, 5)]
        point = (3, 2)
        find_nearest = FindNearest(points, point, CorrelationDistance)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals((2, 3), nearest)

        points = [(2, 3), (3, 4), (4, 5)]
        point = (3, 4)
        find_nearest = FindNearest(points, point, CorrelationDistance)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals((2, 3), nearest)

        test_logger.debug("FindNearestTest - test_correlation_distance Ends")
开发者ID:RayleighChen,项目名称:similarityPy,代码行数:25,代码来源:correlation_distance_test.py

示例4: test_correlation_distance_multiple

    def test_correlation_distance_multiple(self):
        test_logger.debug("FindNearestTest - test_correlation_distance_multiple Starts")

        points = [(2, 3), (4, 6), (6, 5)]
        point = (2, 1)
        find_nearest = FindNearest(points, point, CorrelationDistance, k=2)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals([(6, 5), (2, 3)], nearest)

        points = [(2, 3), (4, 6), (6, 5)]
        point = (3, 2)
        find_nearest = FindNearest(points, point, CorrelationDistance, k=2)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals([(6, 5), (2, 3)], nearest)

        points = [(2, 3), (4, 6), (6, 5)]
        point = (3, 1)
        find_nearest = FindNearest(points, point, CorrelationDistance, k=2)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals([(6, 5), (2, 3)], nearest)

        test_logger.debug("FindNearestTest - test_correlation_distance_multiple Ends")
开发者ID:RayleighChen,项目名称:similarityPy,代码行数:25,代码来源:correlation_distance_test.py

示例5: test_edit_distance

    def test_edit_distance(self):
        test_logger.debug("FindNearestTest - test_edit_distance Starts")

        points = ["abcdef", "abcef", "abcde"]
        point = "abcdefg"
        find_nearest = FindNearest(points, point, EditDistance)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals("abcdef", nearest)

        points = ["abcXdef", "abcXef", "abcXde"]
        point = "abcdefg"
        find_nearest = FindNearest(points, point, EditDistance)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals("abcXdef", nearest)

        points = ["abcXdef", "abcXef", "abcXde"]
        point = "123456"
        find_nearest = FindNearest(points, point, EditDistance)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals("abcXef", nearest)

        points = ["abcXdef", "abcXef", "abcXde"]
        point = "123456 "
        find_nearest = FindNearest(points, point, EditDistance)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals("abcXdef", nearest)

        test_logger.debug("FindNearestTest - test_edit_distance Ends")
开发者ID:RayleighChen,项目名称:similarityPy,代码行数:32,代码来源:edit_distance_test.py

示例6: test_algorithm_with_list

 def test_algorithm_with_list(self):
     test_logger.debug("StandartDeviationTest - test_algorithm_with_list Starts")
     standart_deviation = StandartDeviation()
     data_list = [1, 2, 3, 4, 5]
     self.assertEquals(1.5811, standart_deviation.calculate(data_list))
     data_list = [1, 2, 3, 4]
     self.assertEquals(1.291, standart_deviation.calculate(data_list))
     test_logger.debug("StandartDeviationTest - test_algorithm_with_list Ends")
开发者ID:RayleighChen,项目名称:similarityPy,代码行数:8,代码来源:standart_deviation_test.py

示例7: test_algorithm_with_tuple

    def test_algorithm_with_tuple(self):
        test_logger.debug("MeanTest - test_algorithm_with_tuple Starts")
        mean = Mean()
        data_list = [("a", 1), ("b", 2), ("c", 3), ( "d", 4), ("e", 5)]
        self.assertEquals(3, mean.calculate(data_list, is_tuple=True, index=1))

        data_list = [("a", "a", 1), ("b", "b", 2), ("c", "c", 3), ("d", "d", 4), ("e", "e", 5)]
        self.assertEquals(3.0, mean.calculate(data_list, is_tuple=True, index=2))
        test_logger.debug("MeanTest - test_algorithm_with_tuple Ends")
开发者ID:RayleighChen,项目名称:similarityPy,代码行数:9,代码来源:mean_test.py

示例8: test_manhattan_distance_multiple

    def test_manhattan_distance_multiple(self):
        test_logger.debug("FindNearestTest - test_manhattan_distance_multiple Starts")

        points = [(1, 0, 1, 0, 1, 0), (1, 0, 1, 0, 1, 1), (1, 0, 1, 1, 1, 0)]
        point = (1, 0, 0, 0, 0, 0)
        find_nearest = FindNearest(points, point, ManhattanDistance, k=2)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals([(1, 0, 1, 0, 1, 0), (1, 0, 1, 0, 1, 1)], nearest)

        points = [(1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1), (1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1),
                  (0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1)]
        point = (0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1)
        find_nearest = FindNearest(points, point, ManhattanDistance, k=2)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals([(0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1), (1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1)]
                          , nearest)

        points = [(2, 3), (3, 4), (4, 5)]
        point = (0, 1)
        find_nearest = FindNearest(points, point, ManhattanDistance, k=2)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals([(2, 3), (3, 4)], nearest)

        points = [(2, 3), (3, 4), (4, 5)]
        point = (3, 3)
        find_nearest = FindNearest(points, point, ManhattanDistance, k=2)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals([(2, 3), (2, 3)], nearest)

        points = [(2, 3), (3, 4), (4, 5)]
        point = (3, 4)
        find_nearest = FindNearest(points, point, ManhattanDistance, k=2)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals([(3, 4), (2, 3)], nearest)

        points = [[1], [5], [10]]
        point = [8]
        find_nearest = FindNearest(points, point, ManhattanDistance, k=2)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals([[10], [5]], nearest)

        points = [[1], [5], [10]]
        point = [17]
        find_nearest = FindNearest(points, point, ManhattanDistance, k=2)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals([[10], [5]], nearest)

        test_logger.debug("FindNearestTest - test_manhattan_distance_multiple Ends")
开发者ID:RayleighChen,项目名称:similarityPy,代码行数:55,代码来源:manhattan_distance_test.py

示例9: test_euclidean_distance

    def test_euclidean_distance(self):
        test_logger.debug("FindNearestTest - test_euclidean_distance Starts")

        points = [(1, 0, 1, 0, 1, 0), (1, 0, 1, 0, 1, 1), (1, 0, 1, 1, 1, 0)]
        point = (1, 0, 0, 0, 0, 0)
        find_nearest = FindNearest(points, point, EuclideanDistance)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals((1, 0, 1, 0, 1, 0), nearest)

        points = [(1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1), (1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1),
                  (0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1)]
        point = (0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1)
        find_nearest = FindNearest(points, point, EuclideanDistance)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals((0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1), nearest)

        points = [(2, 3), (3, 4), (4, 5)]
        point = (0, 1)
        find_nearest = FindNearest(points, point, EuclideanDistance)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals((2, 3), nearest)

        points = [(2, 3), (3, 4), (4, 5)]
        point = (3, 3)
        find_nearest = FindNearest(points, point, EuclideanDistance)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals((2, 3), nearest)

        points = [(2, 3), (3, 4), (4, 5)]
        point = (3, 4)
        find_nearest = FindNearest(points, point, EuclideanDistance)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals((3, 4), nearest)

        points = [[1], [5], [10]]
        point = [8]
        find_nearest = FindNearest(points, point, EuclideanDistance)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals([10], nearest)

        points = [[1], [5], [10]]
        point = [17]
        find_nearest = FindNearest(points, point, EuclideanDistance)
        find_nearest.process()
        nearest = find_nearest.get_result()
        self.assertEquals([10], nearest)

        test_logger.debug("FindNearestTest - test_euclidean_distance Ends")
开发者ID:RayleighChen,项目名称:similarityPy,代码行数:54,代码来源:euclidean_distance_test.py

示例10: test_algorithm

    def test_algorithm(self):
        test_logger.debug("FindNearestTest - test_algorithm Starts")

        points = "abcdef"
        point = "abcdefg"
        with self.assertRaises(TypeError) as context:
            FindNearest(points, point, "")
        self.assertEqual("You must initialize array and a point",
                         context.exception.message)

        test_logger.debug("FindNearestTest - test_algorithm Starts")
开发者ID:RayleighChen,项目名称:similarityPy,代码行数:11,代码来源:find_nearest_test.py

示例11: test_algorithm

    def test_algorithm(self):
        test_logger.debug("CosineDistanceTest - test_algorithm Starts")
        data = [(1, 2, 3), (3, 5, 7)]
        cosine_distance = CosineDistance(data)
        cosine_distance.process()
        result = cosine_distance.get_result()
        self.assertEquals(0.002585096956942312, result)

        data = [(1, 2, 3, 4), (1, 2, 3, 6)]
        cosine_distance = CosineDistance(data)
        cosine_distance.process()
        result = cosine_distance.get_result()
        self.assertEquals(0.018844218960787695, result)

        data = [(3, 1), (4, 1)]
        cosine_distance = CosineDistance(data)
        cosine_distance.process()
        result = cosine_distance.get_result()
        self.assertEquals(0.002945514498418511, result)

        data = [[3], [4]]
        cosine_distance = CosineDistance(data)
        cosine_distance.process()
        result = cosine_distance.get_result()
        self.assertEquals(0.0, result)

        data = [[3, 4], [6, 8]]
        cosine_distance = CosineDistance(data)
        cosine_distance.process()
        result = cosine_distance.get_result()
        self.assertEquals(0.0, result)

        data = [[3], [4, 5, 6]]
        cosine_distance = CosineDistance(data)
        with self.assertRaises(ArithmeticError) as context:
            cosine_distance.process()
        self.assertEqual('You cant calculate Cosine distance of array has different sizes.',
                         context.exception.message)

        data = [["a"], [4]]
        cosine_distance = CosineDistance(data)
        with self.assertRaises(TypeError) as context:
            cosine_distance.process()
        self.assertEqual("unsupported operand type(s) for +: 'int' and 'str'",
                         context.exception.message)

        data = []
        cosine_distance = CosineDistance(data)
        with self.assertRaises(ArithmeticError) as context:
            cosine_distance.process()
        self.assertEqual('You must enter two array to find Cosine distance.',
                         context.exception.message)

        test_logger.debug("CosineDistanceTest - test_algorithm Ends")
开发者ID:RayleighChen,项目名称:similarityPy,代码行数:54,代码来源:cosine_distance_test.py

示例12: test_algorithm

    def test_algorithm(self):
        test_logger.debug("ManhattanDistanceTest - test_algorithm Starts")
        data = [(1, 2, 3, 4), (1, 2, 3, 6)]
        manhattan_distance = ManhattanDistance(data)
        manhattan_distance.process()
        result = manhattan_distance.get_result()
        self.assertEquals(2.0, result)

        data = [(1, 2, 3, 4), (5, 6, 7, 8)]
        manhattan_distance = ManhattanDistance(data)
        manhattan_distance.process()
        result = manhattan_distance.get_result()
        self.assertEquals(16.0, result)

        data = [(3, 1), (4, 1)]
        manhattan_distance = ManhattanDistance(data)
        manhattan_distance.process()
        result = manhattan_distance.get_result()
        self.assertEquals(1.0, result)

        data = [(3, 1, 5), (5, 5, 3)]
        manhattan_distance = ManhattanDistance(data)
        manhattan_distance.process()
        result = manhattan_distance.get_result()
        self.assertEquals(8.0, result)

        data = [[3], [4]]
        manhattan_distance = ManhattanDistance(data)
        manhattan_distance.process()
        result = manhattan_distance.get_result()
        self.assertEquals(1.0, result)

        data = [[3], [4, 5, 6]]
        manhattan_distance = ManhattanDistance(data)
        with self.assertRaises(ArithmeticError) as context:
            manhattan_distance.process()
        self.assertEqual('You cant calculate Manhattan distance of array has different sizes.',
                         context.exception.message)

        data = [["a"], [4]]
        manhattan_distance = ManhattanDistance(data)
        with self.assertRaises(TypeError) as context:
            manhattan_distance.process()
        self.assertEqual("unsupported operand type(s) for -: 'int' and 'str'",
                         context.exception.message)

        data = []
        manhattan_distance = ManhattanDistance(data)
        with self.assertRaises(ArithmeticError) as context:
            manhattan_distance.process()
        self.assertEqual('You must enter two array to find Manhattan distance.',
                         context.exception.message)

        test_logger.debug("ManhattanDistanceTest - test_algorithm Ends")
开发者ID:RayleighChen,项目名称:similarityPy,代码行数:54,代码来源:manhattan_distance_test.py

示例13: test_algorithm_with_tuple

    def test_algorithm_with_tuple(self):
        test_logger.debug("VarianceTest - test_algorithm_with_tuple Starts")
        variance = Variance()
        data_list = [("a", 1), ("b", 2), ("c", 3), ( "d", 4), ("e", 5)]
        self.assertEquals(2.5, variance.calculate(data_list, is_tuple=True, index=1))

        data_list = [("a", "a", 1), ("b", "b", 2), ("c", "c", 3), ("d", "d", 4), ("e", "e", 5)]
        self.assertEquals(2.5, variance.calculate(data_list, is_tuple=True, index=2))

        data_list = [("a", "a", 1), ("b", "b", 2), ("c", "c", 3), ("d", "d", 4)]
        self.assertEquals(1.6667, variance.calculate(data_list, is_tuple=True, index=2))
        test_logger.debug("VarianceTest - test_algorithm_with_tuple Ends")
开发者ID:RayleighChen,项目名称:similarityPy,代码行数:12,代码来源:variance_test.py

示例14: test_algorithm_with_tuple

    def test_algorithm_with_tuple(self):
        test_logger.debug("StandartDeviationTest - test_algorithm_with_tuple Starts")
        standart_deviation = StandartDeviation()
        data_list = [("a", 1), ("b", 2), ("c", 3), ( "d", 4), ("e", 5)]
        self.assertEquals(1.5811, standart_deviation.calculate(data_list, is_tuple=True, index=1))

        data_list = [("a", "a", 1), ("b", "b", 2), ("c", "c", 3), ("d", "d", 4), ("e", "e", 5)]
        self.assertEquals(1.5811, standart_deviation.calculate(data_list, is_tuple=True, index=2))

        data_list = [("a", "a", 1), ("b", "b", 2), ("c", "c", 3), ("d", "d", 4)]
        self.assertEquals(1.291, standart_deviation.calculate(data_list, is_tuple=True, index=2))
        test_logger.debug("StandartDeviationTest - test_algorithm_with_tuple Ends")
开发者ID:RayleighChen,项目名称:similarityPy,代码行数:12,代码来源:standart_deviation_test.py

示例15: test_formula

 def test_formula(self):
     test_logger.debug("SumFormulaTest - test_formula Starts")
     sum_formula = SumFormula()
     data_list = [1, 2, 3, 4, 5]
     self.assertEquals(15, sum_formula.calculate(data_list))
     data_list = [1, 2, 3, 4]
     self.assertEquals(10, sum_formula.calculate(data_list))
     data_list = [2]
     self.assertEquals(4, sum_formula.calculate(data_list, power=2))
     data_list = [1, 2, 3, 4]
     self.assertEquals(30, sum_formula.calculate(data_list, power=2))
     test_logger.debug("SumFormulaTest - test_formula Ends")
开发者ID:RayleighChen,项目名称:similarityPy,代码行数:12,代码来源:sum_formula_test.py


注:本文中的tests.test_logger.debug函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。