예제 #1
0
def test_unique_list():
    """removes duplicate entries in the list"""

    assert unique_list([]) == []
    assert unique_list([1]) == [1]
    assert unique_list([1, 2]) == [1, 2]

    assert unique_list([1, 1]) == [1]
    assert unique_list([1, 1, 1]) == [1]
    assert unique_list([1, 1, 2]) == [1, 2]
    assert unique_list([1, 2, 1]) == [1, 2]
    assert unique_list([2, 1, 1]) == [2, 1]
예제 #2
0
    def calls(self):
        """
        Find the list of calls in each module.

        :return: a dictionary keyed by module name with a list of call symbols in the module as the values
        :rtype: dict(str,list(str))
        """
        calls = {}
        module_infos = self.find_modules(self.top_dir)
        for info in module_infos:
            calls[info.module_spec] = sorted(unique_list(info.calls))
        return calls