id int64 0 458k | file_name stringlengths 4 119 | file_path stringlengths 14 227 | content stringlengths 24 9.96M | size int64 24 9.96M | language stringclasses 1
value | extension stringclasses 14
values | total_lines int64 1 219k | avg_line_length float64 2.52 4.63M | max_line_length int64 5 9.91M | alphanum_fraction float64 0 1 | repo_name stringlengths 7 101 | repo_stars int64 100 139k | repo_forks int64 0 26.4k | repo_open_issues int64 0 2.27k | repo_license stringclasses 12
values | repo_extraction_date stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
37,100 | CollectorsTest.py | coala_coala/tests/collecting/CollectorsTest.py | import logging
import os
import pkg_resources
import unittest
from functools import partial
from pyprint.ConsolePrinter import ConsolePrinter
from testfixtures import LogCapture
from coalib.bearlib.aspects import AspectList, get as get_aspect
from coalib.bears.BEAR_KIND import BEAR_KIND
from coalib.bears.Bear import... | 19,078 | Python | .py | 383 | 30.148825 | 80 | 0.470459 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,101 | DependenciesTest.py | coala_coala/tests/collecting/DependenciesTest.py | import unittest
from coalib.bears.Bear import Bear
from coalib.collecting import Dependencies
from coalib.core.CircularDependencyError import CircularDependencyError
class ResolvableBear1(Bear):
BEAR_DEPS = {Bear}
class ResolvableBear2(Bear):
BEAR_DEPS = {ResolvableBear1, Bear}
class UnresolvableBear1(... | 1,473 | Python | .py | 35 | 30.4 | 76 | 0.633475 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,102 | ImportersTest.py | coala_coala/tests/collecting/ImportersTest.py | import os
import unittest
from collections import OrderedDict
from importlib.machinery import (
ModuleSpec,
SourceFileLoader,
)
from inspect import isclass
from coalib.collecting.Importers import import_objects
class ImportObjectsTest(unittest.TestCase):
def setUp(self):
current_dir = os.path.s... | 5,595 | Python | .py | 130 | 29.676923 | 76 | 0.548494 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,103 | bears2.py | coala_coala/tests/collecting/collectors_test_dir/bears_local_global/bears2.py | from coalib.bears.GlobalBear import GlobalBear
from coalib.bears.LocalBear import LocalBear
class Test2LocalBear(LocalBear):
LANGUAGES = {'C', 'Java'}
class Test2GlobalBear(GlobalBear):
LANGUAGES = {'C'}
| 216 | Python | .py | 6 | 33 | 46 | 0.786408 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,104 | bears1.py | coala_coala/tests/collecting/collectors_test_dir/bears_local_global/bears1.py | from coalib.bears.GlobalBear import GlobalBear
from coalib.bears.LocalBear import LocalBear
class Test1LocalBear(LocalBear):
pass
class Test1GlobalBear(GlobalBear):
LANGUAGES = {'All'}
| 197 | Python | .py | 6 | 29.833333 | 46 | 0.823529 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,105 | bear1.py | coala_coala/tests/collecting/collectors_test_dir/bears/bear1.py | import multiprocessing
from coalib.bears.Bear import Bear
from coalib.settings.Section import Section
class TestBear(Bear):
def __init__(self):
Bear.__init__(self, Section('settings'), multiprocessing.Queue())
@staticmethod
def kind():
return 'kind'
def origin(self):
return... | 455 | Python | .py | 17 | 21.176471 | 73 | 0.663551 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,106 | bear2.py | coala_coala/tests/collecting/collectors_test_dir/bears/bear2.py | from bear1 import TestBear as ImportedTestBear
class SubTestBear(ImportedTestBear):
def __init__(self):
ImportedTestBear.__init__(self)
@staticmethod
def kind():
return 'kind'
def origin(self):
return __file__
| 255 | Python | .py | 9 | 22.333333 | 46 | 0.6639 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,107 | incorrect_bear.py | coala_coala/tests/collecting/collectors_test_dir/bears/incorrect_bear.py | The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases arent special enough to break the rules.
Although practicality ... | 853 | Python | .py | 20 | 41.6 | 69 | 0.813702 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,108 | file_one.py | coala_coala/tests/collecting/importers_test_dir/file_one.py | class test(list):
def __init__(self, *args):
list.__init__(self, *args)
@staticmethod
def method():
pass
a = [1, 2, 3]
b = [1, 2, 4]
name = True
| 178 | Python | .py | 9 | 15.111111 | 34 | 0.518293 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,109 | file_two.py | coala_coala/tests/collecting/importers_test_dir/file_two.py | from file_one import test
a = test()
name = False
| 52 | Python | .py | 3 | 15.666667 | 25 | 0.744681 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,110 | conftest.py | coala_coala/tests/settings/conftest.py | import pytest
import coalib.collecting.Collectors
@pytest.fixture
def disable_bears(mocker):
"""
Disable all bears that would otherwise be found with `collect_bears(...)`.
"""
mocker.patch.object(coalib.collecting.Collectors, '_import_bears',
autospec=True, return_value=[])
| 318 | Python | .py | 9 | 29.555556 | 78 | 0.689542 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,111 | SettingTest.py | coala_coala/tests/settings/SettingTest.py | import os
import unittest
from collections import OrderedDict
from coalib.bearlib.languages import Language
from coalib.settings.Setting import (
Setting, path, path_list, url, typed_dict, typed_list, typed_ordered_dict,
glob, glob_list,
language,
float_list, bool_list, int_list, str_list,
)
from coali... | 9,413 | Python | .py | 189 | 36.793651 | 84 | 0.538235 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,112 | SectionTest.py | coala_coala/tests/settings/SectionTest.py | import unittest
import os
from coalib.bearlib.aspects import AspectList, Root, get as get_aspect
from coalib.bearlib.aspects.meta import issubaspect
from coalib.bearlib.languages import Language
from coalib.misc import Constants
from coalib.settings.Section import (
Section, Setting, append_to_sections, extract_as... | 10,331 | Python | .py | 203 | 40.527094 | 79 | 0.614103 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,113 | ConfigurationGatheringTest.py | coala_coala/tests/settings/ConfigurationGatheringTest.py | import os
import tempfile
import unittest
import logging
import sys
from pyprint.ClosableObject import close_objects
from pyprint.NullPrinter import NullPrinter
import pytest
from coalib.bearlib.aspects.Metadata import CommitMessage
from coalib.bearlib.languages import Language
from coalib.misc import Constants
from ... | 19,535 | Python | .py | 405 | 34.276543 | 80 | 0.553647 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,114 | DocstringMetadataTest.py | coala_coala/tests/settings/DocstringMetadataTest.py | import unittest
from coalib.settings.DocstringMetadata import DocstringMetadata
from collections import OrderedDict
class DocstringMetadataTest(unittest.TestCase):
def test_from_docstring(self):
self.check_from_docstring_dataset('')
self.check_from_docstring_dataset(' description only ',
... | 3,492 | Python | .py | 71 | 31.985915 | 79 | 0.527198 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,115 | AnnotationsTest.py | coala_coala/tests/settings/AnnotationsTest.py | from unittest import TestCase
from coalib.settings.Annotations import typechain
class AnnotationsTest(TestCase):
def test_empty(self):
with self.assertRaises(TypeError) as ctx:
typechain()
self.assertEqual(str(ctx.exception), 'No arguments were provided.')
def test_with_lambda(s... | 1,918 | Python | .py | 54 | 25.185185 | 75 | 0.585313 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,116 | FunctionMetadataTest.py | coala_coala/tests/settings/FunctionMetadataTest.py | import unittest
from coalib.settings.FunctionMetadata import FunctionMetadata
from coalib.settings.Section import Section
from coalib.settings.Setting import Setting
class TestClass:
def __init__(self, param1, param2, param3=5, param4: int = 6):
"""
Description
:param param2: d
... | 6,541 | Python | .py | 144 | 31.548611 | 79 | 0.528183 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,117 | SectionFillingTest.py | coala_coala/tests/settings/SectionFillingTest.py | import unittest
from pyprint.ConsolePrinter import ConsolePrinter
from testfixtures import LogCapture
from coalib.bears.GlobalBear import GlobalBear
from coalib.bears.LocalBear import LocalBear
from coala_utils.ContextManagers import simulate_console_inputs
from coalib.output.ConsoleInteraction import acquire_setting... | 4,550 | Python | .py | 92 | 36.119565 | 79 | 0.596436 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,118 | DictUtilitiesTest.py | coala_coala/tests/misc/DictUtilitiesTest.py | import unittest
from collections import OrderedDict
from coalib.misc.DictUtilities import inverse_dicts, update_ordered_dict_key
class DictUtilitiesTest(unittest.TestCase):
def test_inverse_dicts(self):
self.dict1 = {1: [1, 2, 3], 2: [3, 4, 5]}
self.dict2 = {2: [1], 3: [2], 4: [3, 4]}
se... | 2,055 | Python | .py | 39 | 36.410256 | 77 | 0.486554 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,119 | EnumTest.py | coala_coala/tests/misc/EnumTest.py | import unittest
from coalib.misc.Enum import enum
class ProcessTest(unittest.TestCase):
def setUp(self):
self.uut = enum('ZERO', 'ONE', 'TWO', THREE='val')
def test_sequentials(self):
self.assertEqual(self.uut.ZERO, 0)
self.assertEqual(self.uut.ONE, 1)
self.assertEqual(self.... | 812 | Python | .py | 17 | 40.529412 | 77 | 0.673004 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,120 | ContextManagersTest.py | coala_coala/tests/misc/ContextManagersTest.py | import os
import subprocess
import sys
from tempfile import TemporaryDirectory
import unittest
from coala_utils.ContextManagers import (
change_directory, make_temp, prepare_file, retrieve_stdout,
retrieve_stderr, simulate_console_inputs, subprocess_timeout,
suppress_stdout)
from coalib.processes.Processin... | 5,558 | Python | .py | 125 | 30.976 | 76 | 0.556953 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,121 | ShellTest.py | coala_coala/tests/misc/ShellTest.py | from contextlib import ExitStack
import os
import sys
from tempfile import NamedTemporaryFile
import unittest
from coalib.misc.Shell import run_interactive_shell_command, run_shell_command
class RunShellCommandTest(unittest.TestCase):
@staticmethod
def construct_testscript_command(scriptname):
retur... | 3,511 | Python | .py | 70 | 37.885714 | 78 | 0.610884 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,122 | ExceptionsTest.py | coala_coala/tests/misc/ExceptionsTest.py | import unittest
from coalib.misc.Exceptions import get_exitcode
from pkg_resources import VersionConflict
class ExceptionsTest(unittest.TestCase):
def test_get_exitcode(self):
self.assertEqual(get_exitcode(KeyboardInterrupt()), 130)
self.assertEqual(get_exitcode(AssertionError()), 255)
s... | 577 | Python | .py | 12 | 41.416667 | 64 | 0.72549 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,123 | CachingUtilitiesTest.py | coala_coala/tests/misc/CachingUtilitiesTest.py | import os
import unittest
from pyprint.NullPrinter import NullPrinter
from coalib.misc.CachingUtilities import (
get_settings_hash, settings_changed, update_settings_db,
get_data_path, pickle_load, pickle_dump, delete_files)
from coalib.output.printers.LogPrinter import LogPrinter
from coalib.settings.Section... | 2,704 | Python | .py | 54 | 41.777778 | 79 | 0.671353 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,124 | BuildManPageTest.py | coala_coala/tests/misc/BuildManPageTest.py | import argparse
import datetime
import unittest
from distutils.errors import DistutilsOptionError
from setuptools.dist import Distribution
from coalib.misc.BuildManPage import BuildManPage, ManPageFormatter
from coala_utils.ContextManagers import make_temp
app_name = 'name'
app_description = ('short description ' * ... | 5,319 | Python | .py | 119 | 33.252101 | 77 | 0.570932 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,125 | CachingTest.py | coala_coala/tests/misc/CachingTest.py | import unittest
import os
from unittest.mock import patch
from pyprint.NullPrinter import NullPrinter
from pyprint.ConsolePrinter import ConsolePrinter
from coalib.misc.Caching import (
FileCache, FileDictFileCache, ProxyMapFileCache)
from coalib.processes.Processing import get_file_dict
from coalib.io.FileProxy ... | 11,138 | Python | .py | 231 | 35.363636 | 80 | 0.576877 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,126 | test_interactive_program.py | coala_coala/tests/misc/run_shell_command_testfiles/test_interactive_program.py | if __name__ == '__main__':
print('test_program X')
print('Type in a number:')
num = input()
print(num)
print('Exiting program.')
| 149 | Python | .py | 6 | 20.5 | 30 | 0.559441 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,127 | test_input_program.py | coala_coala/tests/misc/run_shell_command_testfiles/test_input_program.py | import sys
if __name__ == '__main__':
data = input()
try:
nums = [int(n) for n in data.split()]
except ValueError:
print('INVALID INPUT', file=sys.stderr)
else:
print(sum(nums))
| 219 | Python | .py | 9 | 18.777778 | 47 | 0.555024 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,128 | ConfWriterTest.py | coala_coala/tests/output/ConfWriterTest.py | import os
import tempfile
import unittest
from coalib.output.ConfWriter import ConfWriter
from coalib.settings.Section import Section
from coalib.settings.ConfigurationGathering import load_configuration
from coalib.output.printers.LogPrinter import LogPrinter
from coala_utils.string_processing import escape
class C... | 5,001 | Python | .py | 111 | 28.396396 | 77 | 0.434613 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,129 | JSONEncoderTest.py | coala_coala/tests/output/JSONEncoderTest.py | import json
import re
import unittest
from datetime import datetime
from coalib.output.JSONEncoder import create_json_encoder
class TestClass1(object):
def __init__(self):
self.a = 0
class TestClass2(object):
def __init__(self):
self.a = 0
self.b = TestClass1()
class TestClass3(... | 2,948 | Python | .py | 78 | 29.871795 | 76 | 0.565891 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,130 | InteractionsTest.py | coala_coala/tests/output/InteractionsTest.py | import unittest
from pyprint.NullPrinter import NullPrinter
from coalib.output.Interactions import fail_acquire_settings
from coalib.output.printers.LogPrinter import LogPrinter
class InteractionsTest(unittest.TestCase):
def test_(self):
log_printer = LogPrinter(NullPrinter())
self.assertRaises... | 639 | Python | .py | 13 | 39 | 78 | 0.679549 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,131 | LoggingTest.py | coala_coala/tests/output/LoggingTest.py | import json
import logging
import unittest
from coalib.output.Logging import configure_json_logging
class LoggingTest(unittest.TestCase):
def test_json_logging(self):
log_stream = configure_json_logging()
logging.debug('This is debug log.')
logging.info('This is info log.')
logg... | 1,255 | Python | .py | 25 | 41.48 | 71 | 0.637776 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,132 | ConsoleInteractionTest.py | coala_coala/tests/output/ConsoleInteractionTest.py | import os
import unittest
from unittest.mock import patch
from collections import OrderedDict
from os.path import abspath, relpath
import logging
from pyprint.ConsolePrinter import ConsolePrinter
from testfixtures import LogCapture, StringComparison
from coalib.bearlib.spacing.SpacingHelper import SpacingHelper
from... | 54,030 | Python | .py | 1,063 | 32.09031 | 80 | 0.482203 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,133 | ListLogPrinterTest.py | coala_coala/tests/output/printers/ListLogPrinterTest.py | import unittest
from datetime import datetime
from coalib.output.printers.ListLogPrinter import ListLogPrinter
from coalib.output.printers.LOG_LEVEL import LOG_LEVEL
from coalib.processes.communication.LogMessage import LogMessage
class ListLogPrinterTest(unittest.TestCase):
def test_logging(self):
uut ... | 997 | Python | .py | 21 | 33.428571 | 65 | 0.588235 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,134 | LogPrinterTest.py | coala_coala/tests/output/printers/LogPrinterTest.py | import unittest
from unittest import mock
import logging
from pyprint.NullPrinter import NullPrinter
from pyprint.Printer import Printer
from coalib.misc import Constants
from coalib.output.printers.LogPrinter import LogPrinter, LogPrinterMixin
from coalib.processes.communication.LogMessage import LOG_LEVEL, LogMessa... | 2,606 | Python | .py | 58 | 37.103448 | 75 | 0.686437 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,135 | LocalBearTestHelperTest.py | coala_coala/tests/testing/LocalBearTestHelperTest.py | from queue import Queue
import sys
import unittest
from tests.test_bears.TestBear import TestBear
from tests.test_bears.AspectsGeneralTestBear import AspectsGeneralTestBear
from tests.test_bears.TestBearDep import (TestDepBearBDependsA,
TestDepBearCDependsB,
... | 10,306 | Python | .py | 210 | 31.357143 | 80 | 0.500149 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,136 | BaseTestHelperTest.py | coala_coala/tests/testing/BaseTestHelperTest.py | import pytest
from coalib.results.Result import Result
from coalib.testing.BaseTestHelper import BaseTestHelper
class BaseTestHelperTest(BaseTestHelper):
def test_good_assert_result_equal(self):
self.assert_result_equal(['a', 'b'], ['a', 'b'])
def test_inequality_assert_result_equal(self):
w... | 1,407 | Python | .py | 25 | 43.2 | 78 | 0.561047 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,137 | DeprecateSettingsTest.py | coala_coala/tests/bearlib/DeprecateSettingsTest.py | import logging
import unittest
from coalib.bearlib import deprecate_settings
@deprecate_settings(new='old')
def func(new):
"""
This docstring will not be lost.
"""
@deprecate_settings(x=('a', lambda a: a+1), y=('a', lambda a: a+2))
def func_2(x, y):
return x+y
class DeprecateSettingsTest(unittest... | 1,629 | Python | .py | 35 | 34.771429 | 80 | 0.577215 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,138 | SectionCreatableTest.py | coala_coala/tests/bearlib/abstractions/SectionCreatableTest.py | import unittest
from coalib.bearlib.abstractions.SectionCreatable import SectionCreatable
from coalib.settings.Section import Section, Setting
class TestObject(SectionCreatable):
def __init__(self,
setting_one: int,
raw_setting,
setting_two: bool = False,
... | 2,357 | Python | .py | 50 | 37.64 | 79 | 0.637195 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,139 | LinterTest.py | coala_coala/tests/bearlib/abstractions/LinterTest.py | import logging
import platform
import os
import re
import sys
import unittest
from unittest.mock import ANY, Mock
from coalib.bearlib.abstractions.Linter import linter
from coalib.results.Diff import Diff
from coalib.results.Result import Result
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
from coalib.re... | 63,453 | Python | .py | 1,245 | 31.928514 | 80 | 0.486934 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,140 | test_linter.py | coala_coala/tests/bearlib/abstractions/linter_test_files/test_linter.py | # This little program tests whether each line begins with one of the primitive
# math operations ``+``, ``-``, ``*`` and ``/``.
#
# Invocation
# ==========
#
# python3 test_linter.py [--config <config-file>] [--use_stderr] [--use_stdin]
# [--correct] <file-to-lint>
#
# Parameters
# ==========
#
#... | 2,485 | Python | .py | 60 | 34.666667 | 79 | 0.558726 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,141 | test_external_bear.py | coala_coala/tests/bearlib/abstractions/external_bear_wrap_testfiles/test_external_bear.py | import sys
import json
from coalib.results.Result import Result
from coalib.results.SourceRange import SourceRange
from coalib.output.JSONEncoder import create_json_encoder
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
if __name__ == '__main__':
line = sys.stdin.read()
args = json.loads(line)
... | 1,253 | Python | .py | 33 | 30.727273 | 74 | 0.654545 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,142 | ExternalBearWrapTest.py | coala_coala/tests/bearlib/abstractions/external_bear_wrap_testfiles/ExternalBearWrapTest.py | import os
import sys
import json
import unittest
from coalib.bearlib.abstractions.ExternalBearWrap import external_bear_wrap
from coalib.results.Result import Result
from coalib.settings.Section import Section
from coalib.results.SourceRange import SourceRange
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY... | 7,345 | Python | .py | 158 | 33.14557 | 80 | 0.566681 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,143 | SpacingHelperTest.py | coala_coala/tests/bearlib/spacing/SpacingHelperTest.py | import unittest
from coalib.bearlib.spacing.SpacingHelper import SpacingHelper
from coalib.settings.Section import Section
class SpacingHelperTest(unittest.TestCase):
def setUp(self):
self.uut = SpacingHelper()
def test_needed_settings(self):
self.assertEqual(list(self.uut.get_optional_sett... | 4,419 | Python | .py | 75 | 46.266667 | 79 | 0.613447 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,144 | ModuleTest.py | coala_coala/tests/bearlib/aspects/ModuleTest.py | from types import ModuleType
import coalib.bearlib.aspects
from coalib.bearlib.aspects.exceptions import (AspectNotFoundError,
MultipleAspectFoundError)
import pytest
import unittest
class aspectsModuleTest(unittest.TestCase):
def test_module(self):
# chec... | 3,828 | Python | .py | 77 | 35.623377 | 79 | 0.585294 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,145 | conftest.py | coala_coala/tests/bearlib/aspects/conftest.py | from coalib.bearlib.aspects import Taste, aspectclass
from coalib.bearlib.aspects.base import aspectbase
import pytest
@pytest.fixture
def RootAspect():
"""
An exclusive Root aspectclass for unit tests.
"""
class RootAspect(aspectbase, metaclass=aspectclass):
parent = None
_tastes = ... | 3,216 | Python | .py | 112 | 22.366071 | 73 | 0.621059 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,146 | RootTest.py | coala_coala/tests/bearlib/aspects/RootTest.py | from coalib.bearlib.aspects import Root, aspectclass
from coalib.bearlib.aspects.base import aspectbase
class RootTest:
def test_class(self):
assert isinstance(Root, aspectclass)
assert issubclass(Root, aspectbase)
def test_class_subaspects(self):
assert isinstance(Root.subaspects, d... | 719 | Python | .py | 18 | 33.166667 | 52 | 0.659452 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,147 | TasteTest.py | coala_coala/tests/bearlib/aspects/TasteTest.py | from coalib.bearlib.aspects import Taste
from coalib.bearlib.aspects.taste import TasteMeta
from coalib.bearlib.languages import Languages
class TasteTest:
def test_class(self):
assert isinstance(Taste, TasteMeta)
def test_class__getitem__(self):
typed = Taste[int]
assert typed.cast_... | 1,242 | Python | .py | 28 | 35.857143 | 71 | 0.65894 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,148 | CollectionsTest.py | coala_coala/tests/bearlib/aspects/CollectionsTest.py | import pytest
import unittest
from coalib.bearlib.aspects import (
AspectNotFoundError, AspectTypeError as aspectTypeError)
from coalib.bearlib.aspects.collections import AspectList
from coalib.bearlib.aspects.meta import isaspect
from coalib.bearlib.aspects.Metadata import Metadata
from coalib.bearlib.aspects.Red... | 7,004 | Python | .py | 130 | 41.746154 | 79 | 0.667153 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,149 | aspectsDocsTest.py | coala_coala/tests/bearlib/aspects/aspectsDocsTest.py | from coalib.bearlib.aspects import Root
from coalib.bearlib.aspects.docs import Documentation
class aspectsDocsTest:
def test_aspects_docs(self):
def check(aspects):
for aspect in aspects:
assert isinstance(aspect.docs, Documentation)
assert aspect.docs.check_... | 425 | Python | .py | 10 | 33 | 61 | 0.680488 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,150 | BaseTest.py | coala_coala/tests/bearlib/aspects/BaseTest.py | from coalib.bearlib.aspects import aspectclass
from coalib.bearlib.aspects.base import aspectbase
import pytest
class AspectBaseTest:
"""
aspectbase is just a mixin base class for new aspectclasses
and is therefore only usable works with a derived aspectclass
and therefore doesn't use the aspectclass... | 626 | Python | .py | 16 | 33.3125 | 65 | 0.733884 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,151 | InstanceTest.py | coala_coala/tests/bearlib/aspects/InstanceTest.py | import pytest
import coalib.bearlib.aspects
import coalib.bearlib.aspects.Metadata as Metadata
class AspectInstanceTest:
def test_instantiation(self, RootAspect, SubAspect, SubSubAspect):
root_instance = RootAspect('py')
instance_counter = 0
def test_child(aspects):
for aspe... | 3,231 | Python | .py | 61 | 42.295082 | 76 | 0.656418 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,152 | SubTest.py | coala_coala/tests/bearlib/aspects/SubTest.py | from coalib.bearlib.aspects import Root, aspectclass, TasteError
from coalib.bearlib.aspects.base import aspectbase
import pytest
class SubAspectTest:
def test_class(self, SubAspect):
assert isinstance(SubAspect, aspectclass)
assert issubclass(SubAspect, aspectbase)
def test_class_tastes_re... | 2,585 | Python | .py | 50 | 40.34 | 75 | 0.61505 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,153 | ExceptionsTest.py | coala_coala/tests/bearlib/aspects/ExceptionsTest.py | import unittest
from coalib.bearlib.aspects.exceptions import AspectLookupError
class ExceptionTest(unittest.TestCase):
def test_AspectLookupError(self):
with self.assertRaisesRegex(
AspectLookupError,
"^Error when trying to search aspect named 'NOASPECT'$"):
... | 356 | Python | .py | 8 | 36 | 73 | 0.718023 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,154 | ClassTest.py | coala_coala/tests/bearlib/aspects/ClassTest.py | from coalib.bearlib.aspects import Root, AspectTypeError as aspectTypeError
from coalib.bearlib.aspects.meta import isaspect, assert_aspect, issubaspect
import pytest
class AspectClassTest:
def test_subaspect_without_definition(self, RootAspect):
error_str = 'must be an instance of one of'
with ... | 2,817 | Python | .py | 74 | 28.189189 | 76 | 0.626378 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,155 | DecoratorsTest.py | coala_coala/tests/bearlib/aspects/DecoratorsTest.py | import unittest
from coalib.bearlib.aspects import (
AspectList,
get as get_aspect,
map_setting_to_aspect,
map_ambiguous_setting_to_aspect,
)
from coalib.bears.LocalBear import LocalBear
from coalib.settings.Section import Section
from coalib.settings.Setting import Setting
class RunDecoratedBear(Loc... | 4,004 | Python | .py | 101 | 30.613861 | 69 | 0.618692 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,156 | LanguageTest.py | coala_coala/tests/bearlib/languages/LanguageTest.py | import pickle
import unittest
from coalib.bearlib.languages.Language import Language, LanguageMeta
class LanguageTest(unittest.TestCase):
def test_class__dir__(self):
assert set(dir(Language)) == {
lang.__name__ for lang in LanguageMeta.all
}.union(type.__dir__(Language))
def te... | 1,528 | Python | .py | 36 | 34.666667 | 78 | 0.666216 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,157 | LanguageDefinitionTest.py | coala_coala/tests/bearlib/languages/LanguageDefinitionTest.py | import unittest
from coalib.bearlib.languages.LanguageDefinition import LanguageDefinition
from coalib.settings.Section import Section
from coalib.settings.Setting import Setting
class LanguageDefinitionTest(unittest.TestCase):
def setUp(self):
self.section = Section('any')
self.section.append(S... | 527 | Python | .py | 12 | 38.5 | 74 | 0.760784 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,158 | DocBaseClassTest.py | coala_coala/tests/bearlib/languages/documentation/DocBaseClassTest.py | import unittest
from coalib.bearlib.languages.documentation.DocstyleDefinition import (
DocstyleDefinition)
from coalib.bearlib.languages.documentation.DocumentationComment import (
DocumentationComment, MalformedComment)
from coalib.bearlib.languages.documentation.DocBaseClass import (
DocBaseClass)
from ... | 21,218 | Python | .py | 416 | 31.382212 | 78 | 0.475554 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,159 | TestUtils.py | coala_coala/tests/bearlib/languages/documentation/TestUtils.py | import os
def load_testdata(filename):
filename = os.path.join(os.path.dirname(
os.path.realpath(__file__)),
os.path.join('documentation_extraction_testdata',
filename))
with open(filename) as test_file:
data = test_file.read()
return data.splitlines(keepends... | 327 | Python | .py | 9 | 28.555556 | 57 | 0.646497 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,160 | DocumentationCommentTest.py | coala_coala/tests/bearlib/languages/documentation/DocumentationCommentTest.py | import unittest
from coalib.bearlib.languages.documentation.DocstyleDefinition import (
DocstyleDefinition)
from coalib.bearlib.languages.documentation.DocumentationComment import (
DocumentationComment, _find_references, SPHINX_REF)
from coalib.bearlib.languages.documentation.DocBaseClass import (
DocBase... | 15,899 | Python | .py | 296 | 38.016892 | 79 | 0.542557 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,161 | DocstyleDefinitionTest.py | coala_coala/tests/bearlib/languages/documentation/DocstyleDefinitionTest.py | import unittest
from unittest.mock import patch
from coalib.bearlib.languages.documentation.DocstyleDefinition import (
DocstyleDefinition)
class DocstyleDefinitionTest(unittest.TestCase):
Metadata = DocstyleDefinition.Metadata
ClassPadding = DocstyleDefinition.ClassPadding
FunctionPadding = Docstyl... | 8,113 | Python | .py | 147 | 36.571429 | 79 | 0.513479 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,162 | doxygen.py | coala_coala/tests/bearlib/languages/documentation/documentation_extraction_testdata/doxygen.py | ## @package pyexample
# Documentation for this module.
#
# More details.
def func():
pass
## Documentation for a class.
#
# More details.
class PyClass:
## The constructor.
def __init__(self):
self._memVar = 0
## Documentation for a method.
# @param self The object pointer.
def PyM... | 862 | Python | .py | 35 | 20.114286 | 66 | 0.654878 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,163 | default.py | coala_coala/tests/bearlib/languages/documentation/documentation_extraction_testdata/default.py | """
Module description.
Some more foobar-like text.
"""
def foobar_explosion(radius):
"""
A nice and neat way of documenting code.
:param radius: The explosion radius. """
def get_55():
"""A function that returns 55."""
return 55
return get_55() * radius
def best_docstring(par... | 1,396 | Python | .py | 48 | 23.270833 | 65 | 0.65188 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,164 | data.py | coala_coala/tests/bearlib/languages/documentation/documentation_extraction_testdata/data.py | """
Module description.
Some more foobar-like text.
"""
def foobar_explosion(radius):
"""
A nice and neat way of documenting code.
:param radius: The explosion radius.
"""
def get_55():
"""
A function that returns 55.
"""
return 55
return get_55() * radius
"""
... | 915 | Python | .py | 40 | 19.2 | 69 | 0.674365 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,165 | DependencyTrackerTest.py | coala_coala/tests/core/DependencyTrackerTest.py | import unittest
from coalib.core.CircularDependencyError import CircularDependencyError
from coalib.core.DependencyTracker import DependencyTracker
class DependencyTrackerTest(unittest.TestCase):
def test_check_circular_dependencies(self):
uut = DependencyTracker()
uut.add(0, 1)
uut.add(... | 5,629 | Python | .py | 134 | 33.022388 | 79 | 0.62102 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,166 | FileBearTest.py | coala_coala/tests/core/FileBearTest.py | from concurrent.futures import ThreadPoolExecutor
from unittest.mock import ANY, patch
from coalib.core.FileBear import FileBear
from coalib.settings.Section import Section
from tests.core.CoreTestBase import CoreTestBase
class TestFileBear(FileBear):
def analyze(self, filename, file):
yield filename
... | 6,408 | Python | .py | 144 | 31.569444 | 77 | 0.563794 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,167 | BearTest.py | coala_coala/tests/core/BearTest.py | import datetime
from itertools import permutations
from os.path import abspath, exists, isfile, join, getmtime
import shutil
import unittest
from dependency_management.requirements.PipRequirement import PipRequirement
from freezegun import freeze_time
import requests
import requests_mock
from coalib.core.Bear impo... | 9,322 | Python | .py | 213 | 33.225352 | 79 | 0.608758 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,168 | CoreTestBase.py | coala_coala/tests/core/CoreTestBase.py | import unittest
from coalib.core.Core import run
class CoreTestBase(unittest.TestCase):
def execute_run(self, bears, cache=None, executor=None):
"""
Executes a coala run and returns the results.
This function has multiple ways to provide a different executor than
the default one ... | 1,236 | Python | .py | 31 | 29.83871 | 79 | 0.604184 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,169 | PersistentHashTest.py | coala_coala/tests/core/PersistentHashTest.py | import unittest
from coalib.core.PersistentHash import persistent_hash
class PersistentHashTest(unittest.TestCase):
def test_int(self):
self.assertEqual(
persistent_hash(3),
b'\xd8YA\x03x|c"@\xe8\x8b~\xb9\xb6\x8d\x95\x8dzp\x8a')
def test_int_tuples(self):
self.assert... | 1,835 | Python | .py | 39 | 35.230769 | 76 | 0.492437 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,170 | CircularDependencyErrorTest.py | coala_coala/tests/core/CircularDependencyErrorTest.py | import unittest
from coalib.core.CircularDependencyError import CircularDependencyError
class CircularDependencyErrorTest(unittest.TestCase):
def test_default_message(self):
with self.assertRaises(CircularDependencyError) as cm:
# test the default case (names is None)
raise Circu... | 707 | Python | .py | 13 | 45 | 76 | 0.708455 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,171 | DependencyBearTest.py | coala_coala/tests/core/DependencyBearTest.py | from concurrent.futures import ThreadPoolExecutor
from unittest.mock import ANY, patch
from coalib.core.DependencyBear import DependencyBear
from coalib.core.FileBear import FileBear
from coalib.core.ProjectBear import ProjectBear
from coalib.settings.Section import Section
from tests.core.CoreTestBase import CoreTes... | 12,393 | Python | .py | 256 | 35.980469 | 79 | 0.600414 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,172 | GraphsTest.py | coala_coala/tests/core/GraphsTest.py | from collections import Iterable
from functools import partial
import unittest
from coalib.core.CircularDependencyError import CircularDependencyError
from coalib.core.Graphs import traverse_graph
def get_successive_nodes(graph, node):
try:
item = graph[node]
except KeyError:
return set()
... | 4,623 | Python | .py | 113 | 32.690265 | 79 | 0.554513 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,173 | CoreTest.py | coala_coala/tests/core/CoreTest.py | from concurrent.futures import ThreadPoolExecutor
import logging
import sys
import unittest
import unittest.mock
from coalib.settings.Section import Section
from coalib.core.Bear import Bear
from coalib.core.Core import initialize_dependencies, run
from coala_utils.decorators import generate_eq
from tests.core.CoreT... | 35,897 | Python | .py | 702 | 41.081197 | 80 | 0.655369 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,174 | ProjectBearTest.py | coala_coala/tests/core/ProjectBearTest.py | from concurrent.futures import ThreadPoolExecutor
from unittest.mock import ANY, patch
from coalib.core.ProjectBear import ProjectBear
from coalib.settings.Section import Section
from tests.core.CoreTestBase import CoreTestBase
class TestProjectBear(ProjectBear):
def analyze(self, files):
yield '\n'.jo... | 7,161 | Python | .py | 163 | 29.815951 | 77 | 0.530425 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,175 | DebugBearsTest.py | coala_coala/tests/bears/DebugBearsTest.py | import unittest
import sys
from io import StringIO
from queue import Queue
from coalib.bears.Bear import Bear, Debugger, debug_run
from coalib.bears.LocalBear import LocalBear
from coalib.settings.Section import Section
from coalib.settings.Setting import Setting
def func1(*args, **kwargs):
yield 1
yield 2
... | 3,506 | Python | .py | 79 | 35.455696 | 80 | 0.605989 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,176 | BearTest.py | coala_coala/tests/bears/BearTest.py | import pdb
import os
from collections import defaultdict
import datetime
from io import BytesIO, StringIO
import multiprocessing
import unittest
from os.path import abspath, exists, isfile, join, getmtime
from tempfile import TemporaryDirectory, NamedTemporaryFile
import shutil
from freezegun import freeze_time
from u... | 31,575 | Python | .py | 664 | 35.709337 | 80 | 0.606409 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,177 | GlobalBearTest.py | coala_coala/tests/bears/GlobalBearTest.py | import unittest
from coalib.bears.GlobalBear import BEAR_KIND, GlobalBear
from coalib.settings.Section import Section
class GlobalBearTest(unittest.TestCase):
def test_file_dict(self):
file_dict_0 = {
'filename1': 'contents1', 'filename2': 'contents2'
}
# check that bear doe... | 914 | Python | .py | 20 | 38.2 | 62 | 0.679864 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,178 | LocalBearTest.py | coala_coala/tests/bears/LocalBearTest.py | import unittest
from coalib.bears.LocalBear import BEAR_KIND, LocalBear
from coalib.settings.Section import Section
class LocalBearTest(unittest.TestCase):
def test_api(self):
test_object = LocalBear(Section('name'), None)
self.assertRaises(NotImplementedError,
test_obj... | 491 | Python | .py | 12 | 30.333333 | 59 | 0.628692 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,179 | AbsolutePositionTest.py | coala_coala/tests/results/AbsolutePositionTest.py | import unittest
from coalib.results.AbsolutePosition import AbsolutePosition, calc_line_col
from coalib.misc.Constants import COMPLEX_TEST_STRING
class AbsolutePositionTest(unittest.TestCase):
def test_calc_line_col_newlines(self):
# no newlines
text = ("find position of 'z'",)
z_pos = t... | 2,511 | Python | .py | 60 | 32.516667 | 75 | 0.585386 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,180 | ResultTest.py | coala_coala/tests/results/ResultTest.py | import unittest
import json
from os.path import abspath
from coalib.results.Diff import Diff
from coalib.results.Result import RESULT_SEVERITY, Result
from coalib.results.SourceRange import SourceRange
from coalib.output.JSONEncoder import create_json_encoder
class ResultTest(unittest.TestCase):
def test_origin... | 8,045 | Python | .py | 174 | 29.436782 | 79 | 0.443608 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,181 | DiffTest.py | coala_coala/tests/results/DiffTest.py | import json
import logging
import unittest
from unidiff.errors import UnidiffParseError
from coalib.output.JSONEncoder import create_json_encoder
from coalib.results.Diff import ConflictError, Diff, SourceRange
class DiffTest(unittest.TestCase):
def setUp(self):
self.file = ['1', '2', '3', '4']
... | 22,814 | Python | .py | 561 | 29.313725 | 78 | 0.508687 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,182 | ResultFilterTest.py | coala_coala/tests/results/ResultFilterTest.py | import os
import unittest
from os.path import abspath
from coalib.results.Diff import Diff
from coalib.results.Result import RESULT_SEVERITY, Result
from coalib.results.ResultFilter import (
filter_results,
remove_range,
remove_result_ranges_diffs)
from coalib.results.SourceRange import SourceRange
class... | 30,359 | Python | .py | 524 | 27.230916 | 80 | 0.362918 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,183 | HiddenResultTest.py | coala_coala/tests/results/HiddenResultTest.py | import unittest
from coalib.results.HiddenResult import HiddenResult
class HiddenResultTest(unittest.TestCase):
def test_hidden_result(self):
uut = HiddenResult('any', 'anything')
self.assertEqual(uut.contents, 'anything')
| 247 | Python | .py | 6 | 36.166667 | 52 | 0.763713 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,184 | SourcePositionTest.py | coala_coala/tests/results/SourcePositionTest.py | import unittest
from os.path import relpath
from coalib.results.SourcePosition import SourcePosition
from coala_utils.ContextManagers import prepare_file
class SourcePositionTest(unittest.TestCase):
def test_initialization(self):
with self.assertRaises(TypeError):
SourcePosition(None, 0)
... | 1,906 | Python | .py | 44 | 34.022727 | 80 | 0.632432 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,185 | RESULT_SEVERITYTest.py | coala_coala/tests/results/RESULT_SEVERITYTest.py | import unittest
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
class RESULT_SEVERITYTest(unittest.TestCase):
def test_str_conversion(self):
self.assertEqual('INFO',
RESULT_SEVERITY.__str__(RESULT_SEVERITY.INFO))
self.assertEqual('NORMAL',
... | 481 | Python | .py | 10 | 36.4 | 73 | 0.633833 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,186 | LineDiffTest.py | coala_coala/tests/results/LineDiffTest.py | import unittest
from coalib.results.LineDiff import LineDiff, ConflictError
class LineDiffTest(unittest.TestCase):
def test_everything(self):
self.assertRaises(TypeError, LineDiff, delete=5)
self.assertRaises(TypeError, LineDiff, change=5)
self.assertRaises(TypeError, LineDiff, add_after... | 1,560 | Python | .py | 30 | 42.033333 | 76 | 0.634931 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,187 | SourceRangeTest.py | coala_coala/tests/results/SourceRangeTest.py | import unittest
from os.path import abspath
from coalib.results.SourcePosition import SourcePosition
from coalib.results.SourceRange import SourceRange
from coalib.results.AbsolutePosition import AbsolutePosition
from coalib.results.Diff import Diff
class SourceRangeTest(unittest.TestCase):
def setUp(self):
... | 5,275 | Python | .py | 106 | 40.858491 | 78 | 0.64454 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,188 | TextRangeTest.py | coala_coala/tests/results/TextRangeTest.py | import unittest
from coalib.results.TextPosition import TextPosition
from coalib.results.TextRange import TextRange
class TextRangeTest(unittest.TestCase):
def test_fail_instantiation(self):
with self.assertRaises(ValueError):
TextRange(TextPosition(3, 4), TextPosition(2, 8))
with s... | 7,587 | Python | .py | 154 | 38.623377 | 77 | 0.614655 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,189 | EnsureFilesPresentTest.py | coala_coala/tests/results/EnsureFilesPresentTest.py | import unittest
from os.path import abspath
from coalib.results.ResultFilter import ensure_files_present
class EnsureFilesPresentTest(unittest.TestCase):
def setUp(self):
self.maxDiff = None
def test_removed_file(self):
test_file = ['abc']
test_file_dict = {'test_file': test_file}
... | 3,466 | Python | .py | 78 | 33.141026 | 74 | 0.544478 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,190 | TextPositionTest.py | coala_coala/tests/results/TextPositionTest.py | import unittest
from coalib.results.TextPosition import TextPosition, ZeroOffsetError
class TextPositionTest(unittest.TestCase):
def test_fail_instantiation(self):
with self.assertRaises(ValueError):
TextPosition(None, 2)
with self.assertRaises(ZeroOffsetError):
TextPosi... | 1,913 | Python | .py | 49 | 29.836735 | 69 | 0.631094 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,191 | ApplyPatchActionTest.py | coala_coala/tests/results/result_actions/ApplyPatchActionTest.py | import unittest
import os
from os.path import isfile
from coala_utils.ContextManagers import make_temp
from coalib.results.Diff import Diff
from coalib.results.Result import Result
from coalib.results.result_actions.ApplyPatchAction import ApplyPatchAction
from coalib.settings.Section import Section
class ApplyPatch... | 6,948 | Python | .py | 154 | 31.142857 | 78 | 0.491135 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,192 | IgnoreResultActionTest.py | coala_coala/tests/results/result_actions/IgnoreResultActionTest.py | import unittest
from os.path import exists
from coala_utils.ContextManagers import make_temp
from coalib.results.Result import Result
from coalib.results.result_actions.IgnoreResultAction import IgnoreResultAction
class IgnoreResultActionTest(unittest.TestCase):
def test_is_applicable(self):
prior_ignor... | 4,831 | Python | .py | 111 | 29.261261 | 79 | 0.505216 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,193 | ShowPatchActionTest.py | coala_coala/tests/results/result_actions/ShowPatchActionTest.py | import unittest
from os.path import join
from coala_utils.ContextManagers import retrieve_stdout
from coalib.results.Diff import Diff
from coalib.results.Result import Result
from coalib.results.result_actions.ShowPatchAction import ShowPatchAction
from coalib.settings.Section import Section, Setting
class ShowPatch... | 5,941 | Python | .py | 115 | 30.008696 | 76 | 0.408989 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,194 | PrintDebugMessageActionTest.py | coala_coala/tests/results/result_actions/PrintDebugMessageActionTest.py | import unittest
from coala_utils.ContextManagers import retrieve_stdout
from coalib.results.Result import Result
from coalib.results.result_actions.PrintDebugMessageAction import (
PrintDebugMessageAction)
from coalib.settings.Section import Section
class PrintDebugMessageActionTest(unittest.TestCase):
def ... | 1,291 | Python | .py | 27 | 33.148148 | 77 | 0.573248 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,195 | AlternatePatchActionTest.py | coala_coala/tests/results/result_actions/AlternatePatchActionTest.py | import unittest
from coalib.results.Result import Result
from coalib.results.Diff import Diff
from coalib.settings.Section import Section, Setting
from coalib.results.result_actions.AlternatePatchAction import (
AlternatePatchAction)
from coala_utils.ContextManagers import retrieve_stdout
class AlternatePatchActi... | 7,535 | Python | .py | 139 | 36.446043 | 78 | 0.532836 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,196 | ShowAppliedPatchesActionTest.py | coala_coala/tests/results/result_actions/ShowAppliedPatchesActionTest.py | import unittest
from coala_utils.ContextManagers import make_temp
from coalib.results.Diff import Diff
from coalib.results.Result import Result
from coalib.results.result_actions.ShowAppliedPatchesAction import (
ShowAppliedPatchesAction)
from coalib.settings.Section import Section
from coala_utils.ContextManagers... | 1,756 | Python | .py | 37 | 32.189189 | 77 | 0.496201 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,197 | OpenEditorActionTest.py | coala_coala/tests/results/result_actions/OpenEditorActionTest.py | import os
import logging
import subprocess
import tempfile
import unittest
from importlib import reload
import coalib.results.result_actions.OpenEditorAction
from coalib.results.Diff import Diff
from coalib.results.Result import Result
from coalib.results.result_actions.OpenEditorAction import OpenEditorAction
from co... | 9,759 | Python | .py | 241 | 30.585062 | 79 | 0.575905 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,198 | PrintAspectActionTest.py | coala_coala/tests/results/result_actions/PrintAspectActionTest.py | import unittest
from coala_utils.ContextManagers import retrieve_stdout
from coalib.results.Result import Result
from coalib.results.result_actions.PrintAspectAction import PrintAspectAction
from coalib.settings.Section import Section
from coalib.bearlib.aspects import Root
class PrintAspectActionTest(unittest.TestC... | 1,748 | Python | .py | 38 | 31.210526 | 79 | 0.550588 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |
37,199 | PrintMoreInfoActionTest.py | coala_coala/tests/results/result_actions/PrintMoreInfoActionTest.py | import unittest
from coala_utils.ContextManagers import retrieve_stdout
from coalib.results.Result import Result
from coalib.results.result_actions.PrintMoreInfoAction import (
PrintMoreInfoAction)
from coalib.settings.Section import Section
class PrintMoreInfoActionTest(unittest.TestCase):
def setUp(self):... | 1,354 | Python | .py | 29 | 32.206897 | 80 | 0.569371 | coala/coala | 3,548 | 1,308 | 834 | AGPL-3.0 | 9/5/2024, 5:15:29 PM (Europe/Amsterdam) |