コード例 #1
0
ファイル: test_graphs.py プロジェクト: cpennington/linesman
    def test_generate_key_unknown(self):
        """ Test that unknown module functions return as strings """
        def test_func(): pass

        stat = Mock()
        stat.code = test_func.__code__

        expected_key = "%s.%s" % (stat.code.co_filename, stat.code.co_name)
        key = linesman._generate_key(stat)
        assert_equals(key, expected_key)
コード例 #2
0
ファイル: test_graphs.py プロジェクト: cpennington/linesman
    def test_generate_key_module(self):
        """ Test that a key is generated for module functions """
        def test_func(): pass

        stat = Mock()
        stat.code = test_func.__code__

        expected_key = "%s.%s" % (self.__module__, stat.code.co_name)
        key = linesman._generate_key(stat)
        assert_equals(key, expected_key)
コード例 #3
0
ファイル: test_graphs.py プロジェクト: cpennington/linesman
    def test_generate_key_unknown(self):
        """ Test that unknown module functions return as strings """
        def test_func():
            pass

        stat = Mock()
        stat.code = test_func.__code__

        expected_key = "%s.%s" % (stat.code.co_filename, stat.code.co_name)
        key = linesman._generate_key(stat)
        assert_equals(key, expected_key)
コード例 #4
0
ファイル: test_graphs.py プロジェクト: cpennington/linesman
    def test_generate_key_module(self):
        """ Test that a key is generated for module functions """
        def test_func():
            pass

        stat = Mock()
        stat.code = test_func.__code__

        expected_key = "%s.%s" % (self.__module__, stat.code.co_name)
        key = linesman._generate_key(stat)
        assert_equals(key, expected_key)
コード例 #5
0
ファイル: test_graphs.py プロジェクト: cpennington/linesman
 def test_generate_key_builtin(self):
     """ Test that a key is generated for built-in functions """
     stat = Mock()
     stat.code = "__builtin__"
     key = linesman._generate_key(stat)
     assert_equals(key, stat.code)
コード例 #6
0
ファイル: test_graphs.py プロジェクト: cpennington/linesman
 def test_generate_key_builtin(self):
     """ Test that a key is generated for built-in functions """
     stat = Mock()
     stat.code = "__builtin__"
     key = linesman._generate_key(stat)
     assert_equals(key, stat.code)