repo_id stringclasses 409
values | prefix large_stringlengths 34 36.3k | target large_stringlengths 1 498 | assertion_type stringclasses 31
values | difficulty stringclasses 8
values | test_file stringlengths 10 121 | test_function stringlengths 1 104 | test_class stringlengths 0 51 | lineno int32 2 11.3k | commit_idx int32 |
|---|---|---|---|---|---|---|---|---|---|
karlicoss/promnesia | from __future__ import annotations
from ...common import Visit
from ...sources.org import extract_from_file
from ..common import get_testdata, throw
def delrf(s: str | None) -> str | None:
if s is None:
return None
# meh.. not sure how ot handle this properly, ideally should be via pytest?
# not s... | 'http://example.org/a_test' | assert | string_literal | src/promnesia/tests/sources/test_org.py | test_url_in_properties | 63 | null | |
karlicoss/promnesia | from typing import cast
import pytest
from ..cannon import CanonifyException, canonify
param = pytest.mark.parametrize
TODO = cast(str, object())
def check(url, expected):
if expected is TODO:
pytest.skip(f"'{url}' will be handled later")
assert canonify(url) == expected
def test(url, expected):
... | CanonifyException) | pytest.raises | variable | src/promnesia/tests/test_cannon.py | test_error | 314 | null | |
karlicoss/promnesia | from datetime import datetime
from pathlib import Path
from subprocess import Popen
import pytest
from ..__main__ import do_index
from .common import promnesia_bin, write_config
from .server_helper import run_server
def test_search_around(tmp_path: Path) -> None:
# this should return visits up to 3 hours in the ... | 18 | assert | numeric_literal | src/promnesia/tests/test_server.py | test_search_around | 236 | null | |
karlicoss/promnesia | from datetime import datetime
from pathlib import Path
from subprocess import Popen
import pytest
from ..__main__ import do_index
from .common import promnesia_bin, write_config
from .server_helper import run_server
def test_status_ok(tmp_path: Path) -> None:
def cfg() -> None:
from promnesia.common impo... | {'total_visits': 10} | assert | collection | src/promnesia/tests/test_server.py | test_status_ok | 51 | null | |
karlicoss/promnesia | from collections import Counter
from pathlib import Path
from subprocess import Popen, check_call
import pytest
from ..__main__ import do_index, read_example_config
from ..common import DbVisit, _is_windows
from ..database.load import get_all_db_visits
from .common import (
get_testdata,
promnesia_bin,
re... | 'demo.com/page0.html' | assert | string_literal | src/promnesia/tests/test_indexer.py | test_hook | 233 | null | |
karlicoss/promnesia | import os
import time
import pytest
import requests
from ..common import _is_windows
from .common import get_testdata, promnesia_bin, tmp_popen
ox_hugo_data = get_testdata('ox-hugo/test/site')
def test_demo() -> None:
if _is_windows:
# for some reason fails to connect to server..
# not sure mayb... | 50 | assert | numeric_literal | src/promnesia/tests/test_cli.py | test_demo | 36 | null | |
karlicoss/promnesia | from __future__ import annotations
from collections.abc import Iterator
from contextlib import ExitStack, contextmanager
from datetime import datetime
from pathlib import Path
from time import sleep
import pytest
from selenium.common.exceptions import TimeoutException
from selenium.webdriver import Remote as Driver
f... | 'error' | assert | string_literal | tests/test_end2end.py | test_bad_port | 158 | null | |
karlicoss/promnesia | from collections import Counter
from pathlib import Path
from subprocess import Popen, check_call
import pytest
from ..__main__ import do_index, read_example_config
from ..common import DbVisit, _is_windows
from ..database.load import get_all_db_visits
from .common import (
get_testdata,
promnesia_bin,
re... | p42 | assert | variable | src/promnesia/tests/test_indexer.py | test_hook | 236 | null | |
karlicoss/promnesia | from __future__ import annotations
from ...common import Visit
from ...sources.org import extract_from_file
from ..common import get_testdata, throw
def delrf(s: str | None) -> str | None:
if s is None:
return None
# meh.. not sure how ot handle this properly, ideally should be via pytest?
# not s... | 6 | assert | numeric_literal | src/promnesia/tests/sources/test_org.py | test_org_indexer_2 | 37 | null | |
karlicoss/promnesia | from unittest.mock import patch
from ..common import traverse
from .common import get_testdata
testDataPath = get_testdata('traverse')
@patch('promnesia.common.shutil.which', return_value=False)
def test_traverse_ignore_find(patched) -> None:
'''
traverse() with `find` but ignore some stuff
'''
paths... | {testDataPath / 'imhere2/real.txt', testDataPath / 'imhere.txt'} | assert | collection | src/promnesia/tests/test_traverse.py | test_traverse_ignore_find | 18 | null | |
karlicoss/promnesia | from __future__ import annotations
from collections.abc import Iterator
from contextlib import ExitStack, contextmanager
from datetime import datetime
from pathlib import Path
from time import sleep
import pytest
from selenium.common.exceptions import TimeoutException
from selenium.webdriver import Remote as Driver
f... | sanitized | assert | variable | tests/test_end2end.py | test_sidebar_basic | 389 | null | |
karlicoss/promnesia | from __future__ import annotations
from contextlib import contextmanager
from pathlib import Path
from tempfile import TemporaryDirectory
import pytest
from more_itertools import ilen
from ..common import Source
from ..config import Config, import_config
from .common import throw
def make(body: str) -> Config:
... | 0 | assert | numeric_literal | src/promnesia/tests/test_config.py | index | 43 | null | |
karlicoss/promnesia | from __future__ import annotations
from contextlib import contextmanager
from pathlib import Path
from tempfile import TemporaryDirectory
import pytest
from more_itertools import ilen
from ..common import Source
from ..config import Config, import_config
from .common import throw
def make(body: str) -> Config:
... | 2 | assert | numeric_literal | src/promnesia/tests/test_config.py | test_sources_errors | 249 | null | |
karlicoss/promnesia | from __future__ import annotations
from concurrent.futures import ProcessPoolExecutor
from datetime import datetime, timedelta, timezone
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Any, cast
from zoneinfo import ZoneInfo
import pytest
from hypothesis import given, settings
from... | str(err) | assert | func_call | src/promnesia/tests/test_db_dump.py | test_no_visits | 45 | null | |
karlicoss/promnesia | from typing import cast
import pytest
from ..cannon import CanonifyException, canonify
param = pytest.mark.parametrize
TODO = cast(str, object())
def check(url, expected):
if expected is TODO:
pytest.skip(f"'{url}' will be handled later")
assert canonify(url) == expected
def test(url, expected):
... | c | assert | variable | src/promnesia/tests/test_cannon.py | test_same_norm | 309 | null | |
karlicoss/promnesia | import pytest
from ...common import Source, _is_windows
from ...extract import extract_visits
from ...sources import shellcmd
from ..common import get_testdata
@pytest.mark.skipif(_is_windows, reason="no grep on windows")
def test_via_grep() -> None:
visits = list(
extract_visits(
Source(
... | 5 | assert | numeric_literal | src/promnesia/tests/sources/test_shellcmd.py | test_via_grep | 22 | null | |
karlicoss/promnesia | from unittest.mock import patch
from ..common import traverse
from .common import get_testdata
testDataPath = get_testdata('traverse')
def test_traverse_ignore_fdfind():
'''
traverse() with `fdfind` but ignore some stuff
'''
paths = set(traverse(testDataPath, ignore=['ignoreme.txt', 'ignoreme2']))
... | {testDataPath / 'imhere.txt', testDataPath / 'imhere2/real.txt'} | assert | collection | src/promnesia/tests/test_traverse.py | test_traverse_ignore_fdfind | 27 | null | |
karlicoss/promnesia | from __future__ import annotations
import gc
import inspect
import os
import socket
import sys
from collections.abc import Iterator
from contextlib import closing, contextmanager
from pathlib import Path
from textwrap import dedent
from typing import NoReturn
import pytest
from ..common import Res, _is_windows
def ... | cfg_src | assert | variable | src/promnesia/tests/common.py | write_config | 109 | null | |
karlicoss/promnesia | from __future__ import annotations
import os
import shlex
from collections.abc import Callable, Iterator
from contextlib import contextmanager
from dataclasses import dataclass
from pathlib import Path
from pprint import pformat
from time import sleep
from typing import Literal
import click
import psutil
import pytes... | None | assert | none_literal | tests/webdriver_utils.py | frame_context | 86 | null | |
karlicoss/promnesia | from __future__ import annotations
import os
import shlex
from collections.abc import Callable, Iterator
from contextlib import contextmanager
from dataclasses import dataclass
from pathlib import Path
from pprint import pformat
from time import sleep
from typing import Literal
import click
import psutil
import pytes... | cmdline | assert | variable | tests/webdriver_utils.py | get_browser_process | 306 | null | |
karlicoss/promnesia | from ..common import extract_urls
def test_extract_2() -> None:
text = '''♂️ Чтобы снизить вероятность ошибиться, важно знать про когнитивные искажения.
Если для вас это новое словосочетание, начните с книжки
"Гарри Поттер и Методы рационального мышления" - http://hpmor.ru/, если вы знакомы с понятием - ч... | {'http://hpmor.ru/', 'lesswrong.ru', 'lesswrong.com', 'https://t.me/ontologics'} | assert | collection | src/promnesia/tests/test_extract_urls.py | test_extract_2 | 18 | null | |
karlicoss/promnesia | from __future__ import annotations
import functools
import json
import time
from collections.abc import Iterator, Sequence
from contextlib import contextmanager
from dataclasses import dataclass
from pathlib import Path
from time import sleep
import pytest
from selenium.common.exceptions import TimeoutException
from ... | '' | assert | string_literal | tests/addon.py | _set_position | OptionsPage | 266 | null |
karlicoss/promnesia | from __future__ import annotations
from ...common import Visit
from ...sources.org import extract_from_file
from ..common import get_testdata, throw
def delrf(s: str | None) -> str | None:
if s is None:
return None
# meh.. not sure how ot handle this properly, ideally should be via pytest?
# not s... | 'https://twitter.com/Mappletons/status/1255221220263563269' | assert | string_literal | src/promnesia/tests/sources/test_org.py | test_org_indexer | 31 | null | |
karlicoss/promnesia | from __future__ import annotations
from concurrent.futures import ProcessPoolExecutor
from datetime import datetime, timedelta, timezone
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Any, cast
from zoneinfo import ZoneInfo
import pytest
from hypothesis import given, settings
from... | DbVisit( norm_url='i.redd.it/alala.jpg', orig_url='https://i.redd.it/alala.jpg', dt=datetime(2019, 4, 13, 11, 55, 9, tzinfo=timezone(timedelta(hours=-4))), locator=Loc.make(title='Reddit save', href='https://reddit.com/r/whatever'), src='reddit', context='', ) | assert | func_call | src/promnesia/tests/test_db_dump.py | test_read_db_visits | 126 | null | |
karlicoss/promnesia | from datetime import datetime
from pathlib import Path
from subprocess import Popen
import pytest
from ..__main__ import do_index
from .common import promnesia_bin, write_config
from .server_helper import run_server
def test_status_error() -> None:
"""
If DB doesn't exist, server should handle it gracefully ... | None | assert | none_literal | src/promnesia/tests/test_server.py | test_status_error | 25 | null | |
karlicoss/promnesia | from collections import Counter
from pathlib import Path
from subprocess import Popen, check_call
import pytest
from ..__main__ import do_index, read_example_config
from ..common import DbVisit, _is_windows
from ..database.load import get_all_db_visits
from .common import (
get_testdata,
promnesia_bin,
re... | "urbandictionary.com/define.php?term=Belgian%20Whistle" | assert | string_literal | src/promnesia/tests/test_indexer.py | test_weird_urls | 158 | null | |
karlicoss/promnesia | from __future__ import annotations
from collections.abc import Iterator
from contextlib import ExitStack, contextmanager
from datetime import datetime
from pathlib import Path
from time import sleep
import pytest
from selenium.common.exceptions import TimeoutException
from selenium.webdriver import Remote as Driver
f... | '1/1/1980, 12:00:00 AM' | assert | string_literal | tests/test_end2end.py | test_showvisits_popup | 777 | null | |
karlicoss/promnesia | from __future__ import annotations
from collections.abc import Iterator
from contextlib import ExitStack, contextmanager
from datetime import datetime
from pathlib import Path
from time import sleep
import pytest
from selenium.common.exceptions import TimeoutException
from selenium.webdriver import Remote as Driver
f... | hl.text | assert | complex_expr | tests/test_end2end.py | test_search_around | 312 | null | |
karlicoss/promnesia | from datetime import datetime
from pathlib import Path
from subprocess import Popen
import pytest
from ..__main__ import do_index
from .common import promnesia_bin, write_config
from .server_helper import run_server
def test_visits(tmp_path: Path) -> None:
def cfg() -> None:
from promnesia.common import ... | 'demo' | assert | string_literal | src/promnesia/tests/test_server.py | test_visits | 74 | null | |
karlicoss/promnesia | from __future__ import annotations
import sys
import time
from collections.abc import Iterator
from contextlib import contextmanager
from dataclasses import dataclass
from pathlib import Path
from typing import Any
import psutil
import requests
from ..common import PathIsh
from .common import free_port, promnesia_bi... | None | assert | none_literal | src/promnesia/tests/server_helper.py | get | Backend | 27 | null |
karlicoss/promnesia | from collections.abc import Mapping, Sequence
from datetime import datetime, timedelta
from pathlib import Path
from ..common import Loc, Source, Visit
from ..database.dump import visits_to_sqlite
from ..extract import extract_visits
Urls = Mapping[str, str | None] | Sequence[tuple[str, str | None]]
def idx(tmp_... | 0 | assert | numeric_literal | src/promnesia/tests/utils.py | idx | 31 | null | |
karlicoss/promnesia | import os
from itertools import groupby
from ...sources import auto
from ..common import get_testdata, throw
sa2464 = 'https://www.scottaaronson.com/blog/?p=2464'
_JSON_URLS = {
'https://johncarlosbaez.wordpress.com/2016/09/09/struggles-with-the-continuum-part-2/',
sa2464,
}
def makemap(visits):
key = l... | 'orgs' + os.sep + 'file.org:14' | assert | string_literal | src/promnesia/tests/sources/test_auto.py | test_auto | 48 | null | |
karlicoss/promnesia | from __future__ import annotations
from collections.abc import Iterator
from contextlib import ExitStack, contextmanager
from datetime import datetime
from pathlib import Path
from time import sleep
import pytest
from selenium.common.exceptions import TimeoutException
from selenium.webdriver import Remote as Driver
f... | 'some comment' | assert | string_literal | tests/test_end2end.py | test_showvisits_popup | 774 | null | |
karlicoss/promnesia | from __future__ import annotations
from concurrent.futures import ProcessPoolExecutor
from datetime import datetime, timedelta, timezone
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Any, cast
from zoneinfo import ZoneInfo
import pytest
from hypothesis import given, settings
from... | 0 | assert | numeric_literal | src/promnesia/tests/test_db_dump.py | test_one_visit | 68 | null | |
karlicoss/promnesia | from pathlib import Path
from my.core.cfg import tmp_config
from ...__main__ import do_index
from ...database.load import get_all_db_visits
from ..common import get_testdata, write_config
def index_hypothesis(tmp_path: Path) -> None:
def cfg() -> None:
from promnesia.common import Source
from pro... | 'https://hyp.is/_Z9ccmVZEeexBOO7mToqdg/www.wired.com/2017/04/the-myth-of-a-superhuman-ai/' | assert | string_literal | src/promnesia/tests/sources/test_hypothesis.py | test_hypothesis | 38 | null | |
karlicoss/promnesia | from collections import Counter
from pathlib import Path
from subprocess import Popen, check_call
import pytest
from ..__main__ import do_index, read_example_config
from ..common import DbVisit, _is_windows
from ..database.load import get_all_db_visits
from .common import (
get_testdata,
promnesia_bin,
re... | {'demo1': 10, 'demo2': 20} | assert | collection | src/promnesia/tests/test_indexer.py | test_indexing_mode | 45 | null | |
karlicoss/promnesia | from __future__ import annotations
from ...common import Visit
from ...sources.org import extract_from_file
from ..common import get_testdata, throw
def delrf(s: str | None) -> str | None:
if s is None:
return None
# meh.. not sure how ot handle this properly, ideally should be via pytest?
# not s... | 2 | assert | numeric_literal | src/promnesia/tests/sources/test_org.py | test_url_in_properties | 61 | null | |
karlicoss/promnesia | import os
from itertools import groupby
from ...sources import auto
from ..common import get_testdata, throw
sa2464 = 'https://www.scottaaronson.com/blog/?p=2464'
_JSON_URLS = {
'https://johncarlosbaez.wordpress.com/2016/09/09/struggles-with-the-continuum-part-2/',
sa2464,
}
def makemap(visits):
key = l... | 'list::yyy::given_url' | assert | string_literal | src/promnesia/tests/sources/test_auto.py | test_json | 32 | null | |
karlicoss/promnesia | from collections import Counter
from pathlib import Path
from subprocess import Popen, check_call
import pytest
from ..__main__ import do_index, read_example_config
from ..common import DbVisit, _is_windows
from ..database.load import get_all_db_visits
from .common import (
get_testdata,
promnesia_bin,
re... | 0 | assert | numeric_literal | src/promnesia/tests/test_indexer.py | test_concurrent_indexing | 108 | null | |
karlicoss/promnesia | from __future__ import annotations
from ...common import Visit
from ...sources.org import extract_from_file
from ..common import get_testdata, throw
def delrf(s: str | None) -> str | None:
if s is None:
return None
# meh.. not sure how ot handle this properly, ideally should be via pytest?
# not s... | exp | assert | variable | src/promnesia/tests/sources/test_org.py | test_org_indexer | 29 | null | |
karlicoss/promnesia | from __future__ import annotations
from concurrent.futures import ProcessPoolExecutor
from datetime import datetime, timedelta, timezone
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Any, cast
from zoneinfo import ZoneInfo
import pytest
from hypothesis import given, settings
from... | { 'context': None, 'dt': '2023-11-14T23:11:01+01:00', 'duration': 123, 'locator_href': 'https://whatever.com', 'locator_title': 'title', 'norm_url': 'google.com', 'orig_url': 'https://google.com', 'src': 'whatever', } | assert | collection | src/promnesia/tests/test_db_dump.py | test_one_visit | 74 | null | |
karlicoss/promnesia | from datetime import UTC, datetime
import pytest
from my.core.cfg import tmp_config
from ...common import Source
from ...extract import extract_visits
from ...sources import takeout
from ..common import get_testdata, unwrap
def no_cachew():
from my.core.cachew import disabled_cachew
with disabled_cachew():
... | edt | assert | variable | src/promnesia/tests/sources/test_takeout.py | test_takeout_zip | 56 | null | |
karlicoss/promnesia | import os
import time
import pytest
import requests
from ..common import _is_windows
from .common import get_testdata, promnesia_bin, tmp_popen
ox_hugo_data = get_testdata('ox-hugo/test/site')
def test_demo() -> None:
if _is_windows:
# for some reason fails to connect to server..
# not sure mayb... | 1 | assert | numeric_literal | src/promnesia/tests/test_cli.py | test_demo | 45 | null | |
karlicoss/promnesia | from __future__ import annotations
from ...common import Visit
from ...sources.org import extract_from_file
from ..common import get_testdata, throw
def delrf(s: str | None) -> str | None:
if s is None:
return None
# meh.. not sure how ot handle this properly, ideally should be via pytest?
# not s... | 0 | assert | numeric_literal | src/promnesia/tests/sources/test_org.py | test_5 | 69 | null | |
karlicoss/promnesia | from collections import Counter
from pathlib import Path
from subprocess import Popen, check_call
import pytest
from ..__main__ import do_index, read_example_config
from ..common import DbVisit, _is_windows
from ..database.load import get_all_db_visits
from .common import (
get_testdata,
promnesia_bin,
re... | 'patched.com' | assert | string_literal | src/promnesia/tests/test_indexer.py | test_hook | 234 | null | |
karlicoss/promnesia | from __future__ import annotations
import functools
import json
import time
from collections.abc import Iterator, Sequence
from contextlib import contextmanager
from dataclasses import dataclass
from pathlib import Path
from time import sleep
import pytest
from selenium.common.exceptions import TimeoutException
from ... | 10 | assert | numeric_literal | tests/addon.py | close | Sidebar | 125 | null |
karlicoss/promnesia | from typing import cast
import pytest
from ..cannon import CanonifyException, canonify
param = pytest.mark.parametrize
TODO = cast(str, object())
def check(url, expected):
if expected is TODO:
pytest.skip(f"'{url}' will be handled later")
assert canonify(url) == | expected | assert | variable | src/promnesia/tests/test_cannon.py | check | 24 | null | |
karlicoss/promnesia | from __future__ import annotations
from collections.abc import Iterator
from contextlib import ExitStack, contextmanager
from datetime import datetime
from pathlib import Path
from time import sleep
import pytest
from selenium.common.exceptions import TimeoutException
from selenium.webdriver import Remote as Driver
f... | TimeoutException) | pytest.raises | variable | tests/test_end2end.py | test_click_before_page_loaded | 648 | null | |
karlicoss/promnesia | from __future__ import annotations
from contextlib import contextmanager
from datetime import datetime, timedelta
from pathlib import Path
from subprocess import check_call
from time import sleep
from .addon_helper import get_window_id
from .common import uses_x
from .record import CURSOR_SCRIPT, SELECT_SCRIPT, hotke... | FIREFOX | assert | variable | tests/demos.py | test_demo_highlights | 523 | null | |
karlicoss/promnesia | from ...common import Source
from ...extract import extract_visits
from ...sources import plaintext, shellcmd
from ..common import get_testdata, unwrap
def test_plaintext_path_extractor() -> None:
visits = list(
extract_visits(
Source(
shellcmd.index,
plaintext.e... | { 'http://google.com', 'http://google.com/', 'http://some-weird-domain.xyz/whatever', 'https://google.com', 'http://what.about.this.link', } | assert | collection | src/promnesia/tests/sources/test_plaintext.py | test_plaintext_path_extractor | 17 | null | |
karlicoss/promnesia | from __future__ import annotations
from collections.abc import Iterator
from contextlib import ExitStack, contextmanager
from datetime import datetime
from pathlib import Path
from time import sleep
import pytest
from selenium.common.exceptions import TimeoutException
from selenium.webdriver import Remote as Driver
f... | _all.text | assert | complex_expr | tests/test_end2end.py | test_sidebar_basic | 378 | null | |
karlicoss/promnesia | from __future__ import annotations
from contextlib import contextmanager
from pathlib import Path
from tempfile import TemporaryDirectory
import pytest
from more_itertools import ilen
from ..common import Source
from ..config import Config, import_config
from .common import throw
def make(body: str) -> Config:
... | 'legacy name' | assert | string_literal | src/promnesia/tests/test_config.py | test_legacy | 287 | null | |
karlicoss/promnesia | from __future__ import annotations
from contextlib import contextmanager
from pathlib import Path
from tempfile import TemporaryDirectory
import pytest
from more_itertools import ilen
from ..common import Source
from ..config import Config, import_config
from .common import throw
def make(body: str) -> Config:
... | 'nice name' | assert | string_literal | src/promnesia/tests/test_config.py | test_sources_style_2 | 180 | null | |
karlicoss/promnesia | from __future__ import annotations
from ...common import Visit
from ...sources.org import extract_from_file
from ..common import get_testdata, throw
def delrf(s: str | None) -> str | None:
if s is None:
return None
# meh.. not sure how ot handle this properly, ideally should be via pytest?
# not s... | 'https://link.com' | assert | string_literal | src/promnesia/tests/sources/test_org.py | test_org_indexer_2 | 42 | null | |
gotalab/skillport | import json
from skillport.modules.skills import (
check_update_available,
detect_local_modification,
update_skill,
)
from skillport.modules.skills.internal import (
compute_content_hash,
get_missing_skill_ids,
get_tracked_skill_ids,
get_untracked_skill_ids,
record_origin,
scan_inst... | [] | assert | collection | tests/unit/test_update.py | test_tracked_skill_not_in_untracked | TestGetUntrackedSkillIds | 571 | null |
gotalab/skillport | import base64
from unittest.mock import patch
import pytest
from skillport.interfaces.mcp.instructions import build_xml_instructions
from skillport.interfaces.mcp.server import _get_registered_tools_list
from skillport.modules.skills.public.types import FileContent
from skillport.shared.config import Config
class Te... | result.mime_type | assert | complex_expr | tests/unit/test_transport_mode.py | test_text_file_returns_utf8 | TestReadSkillFileBinarySupport | 170 | null |
gotalab/skillport | import string
from hypothesis import assume, given, settings
from hypothesis import strategies as st
from skillport.modules.skills.internal.validation import (
NAME_MAX_LENGTH,
_validate_name_chars,
validate_skill_record,
)
valid_name_chars = st.sampled_from(string.ascii_lowercase + string.digits + "-")
... | normalized_twice | assert | variable | tests/pbt/test_name_properties.py | test_normalization_is_idempotent | TestCategoryNormalizationProperty | 143 | null |
gotalab/skillport | from pathlib import Path
import pytest
from skillport.shared.config import SKILLPORT_HOME, Config
class TestCoreSkillsModeConfig:
def test_core_skills_mode_default_is_auto(self, monkeypatch):
"""SKILLPORT_CORE_SKILLS_MODE defaults to 'auto'."""
monkeypatch.delenv("SKILLPORT_CORE_SKILLS_MODE", ra... | "auto" | assert | string_literal | tests/unit/test_config.py | test_core_skills_mode_default_is_auto | TestCoreSkillsModeConfig | 211 | null |
gotalab/skillport | import pytest
from skillport.modules.skills.internal.validation import (
ALLOWED_FRONTMATTER_KEYS,
COMPATIBILITY_MAX_LENGTH,
DESCRIPTION_MAX_LENGTH,
NAME_MAX_LENGTH,
RESERVED_WORDS,
SKILL_LINE_THRESHOLD,
validate_skill_record,
)
class TestValidationFatal:
def test_name_exactly_64_char... | 0 | assert | numeric_literal | tests/unit/test_validation_rules.py | test_name_exactly_64_chars_ok | TestValidationFatal | 64 | null |
gotalab/skillport | from pathlib import Path
from types import SimpleNamespace
from unittest.mock import patch
import pytest
from skillport.modules.indexing import search as idx_search
from skillport.modules.skills import read_skill_file, search_skills
from skillport.shared.config import Config
def _make_config(tmp_path: Path) -> Confi... | ["ml-skill"] | assert | collection | tests/integration/test_search_and_tools_integration.py | test_filter_respects_enabled_categories | 175 | null | |
gotalab/skillport | import base64
from unittest.mock import patch
import pytest
from skillport.interfaces.mcp.instructions import build_xml_instructions
from skillport.interfaces.mcp.server import _get_registered_tools_list
from skillport.modules.skills.public.types import FileContent
from skillport.shared.config import Config
class Te... | "key: value" | assert | string_literal | tests/unit/test_transport_mode.py | test_yaml_file_returns_utf8 | TestReadSkillFileBinarySupport | 251 | null |
gotalab/skillport | from skillport.modules.skills.internal import (
compute_content_hash,
get_all_origins,
get_origin,
migrate_origin_v2,
prune_orphan_origins,
record_origin,
update_origin,
)
from skillport.shared.config import Config
class TestUpdateOrigin:
def test_update_origin_history_rotation(self, t... | 10 | assert | numeric_literal | tests/unit/test_origin_v2.py | test_update_origin_history_rotation | TestUpdateOrigin | 258 | null |
gotalab/skillport | import json
from skillport.modules.skills import (
check_update_available,
detect_local_modification,
update_skill,
)
from skillport.modules.skills.internal import (
compute_content_hash,
get_missing_skill_ids,
get_tracked_skill_ids,
get_untracked_skill_ids,
record_origin,
scan_inst... | True | assert | bool_literal | tests/unit/test_update.py | test_different_hash_returns_true | TestDetectLocalModification | 84 | null |
gotalab/skillport | import base64
from pathlib import Path
import pytest
from fastmcp.client import Client
from skillport.interfaces.mcp.server import create_mcp_server
from skillport.modules.indexing import build_index
from skillport.shared.config import Config
def _create_test_skill(skills_dir: Path, skill_id: str, content: str = "Te... | "utf-8" | assert | string_literal | tests/integration/test_mcp_server.py | test_read_skill_file_text | TestRemoteMode | 142 | null |
gotalab/skillport | import base64
from unittest.mock import patch
import pytest
from skillport.interfaces.mcp.instructions import build_xml_instructions
from skillport.interfaces.mcp.server import _get_registered_tools_list
from skillport.modules.skills.public.types import FileContent
from skillport.shared.config import Config
class Te... | png_bytes | assert | variable | tests/unit/test_transport_mode.py | test_binary_file_returns_base64 | TestReadSkillFileBinarySupport | 201 | null |
gotalab/skillport | from skillport.modules.skills.internal import origin as origin_mod
from skillport.shared.config import Config
def test_record_and_remove_origin(tmp_path):
cfg = Config(meta_dir=tmp_path)
origin_mod.record_origin("abc", {"source": "local"}, config=cfg)
path = tmp_path / "origins.json"
assert path.exist... | data | assert | variable | tests/unit/test_origin.py | test_record_and_remove_origin | 13 | null | |
gotalab/skillport | import zipfile
import pytest
from skillport.modules.skills.internal.zip_handler import (
MAX_EXTRACTED_BYTES,
MAX_FILE_BYTES,
MAX_ZIP_FILES,
extract_zip,
)
class TestExtractZipSecurity:
def test_rejects_too_many_files(self, tmp_path):
"""Zip with too many files is rejected."""
zi... | ValueError, match="too many files") | pytest.raises | complex_expr | tests/unit/test_zip_handler.py | test_rejects_too_many_files | TestExtractZipSecurity | 128 | null |
gotalab/skillport | from unittest.mock import MagicMock, patch
from skillport.modules.indexing.public.query import get_core_skills
from skillport.shared.config import Config
class TestGetCoreSkillsAutoMode:
def test_auto_mode_returns_always_apply_skills(self):
"""mode=auto returns skills with alwaysApply=true."""
co... | 1 | assert | numeric_literal | tests/unit/test_core_skills_mode.py | test_auto_mode_returns_always_apply_skills | TestGetCoreSkillsAutoMode | 27 | null |
gotalab/skillport | from pathlib import Path
import pytest
from skillport.shared.config import SKILLPORT_HOME, Config
class TestConfigFilters:
def test_enabled_categories_json_format(self, monkeypatch):
"""SKILLPORT_ENABLED_CATEGORIES parsed as JSON list."""
monkeypatch.setenv("SKILLPORT_ENABLED_CATEGORIES", '["dev... | ["dev", "test"] | assert | collection | tests/unit/test_config.py | test_enabled_categories_json_format | TestConfigFilters | 125 | null |
gotalab/skillport | from skillport.modules.skills.internal import (
compute_content_hash,
get_all_origins,
get_origin,
migrate_origin_v2,
prune_orphan_origins,
record_origin,
update_origin,
)
from skillport.shared.config import Config
class TestMigrateOriginV2:
def test_migrate_preserves_existing_v2_field... | 1 | assert | numeric_literal | tests/unit/test_origin_v2.py | test_migrate_preserves_existing_v2_fields | TestMigrateOriginV2 | 61 | null |
gotalab/skillport | from pathlib import Path
from skillport.interfaces.cli.commands.doc import (
MARKER_END,
MARKER_START,
_truncate_description,
generate_skills_block,
update_agents_md,
)
from skillport.modules.skills import SkillSummary
class TestTruncateDescription:
def test_newlines_replaced(self):
"... | result | assert | variable | tests/unit/test_doc.py | test_newlines_replaced | TestTruncateDescription | 37 | null |
gotalab/skillport | import base64
from unittest.mock import patch
import pytest
from skillport.interfaces.mcp.instructions import build_xml_instructions
from skillport.interfaces.mcp.server import _get_registered_tools_list
from skillport.modules.skills.public.types import FileContent
from skillport.shared.config import Config
class Te... | "image/png" | assert | string_literal | tests/unit/test_transport_mode.py | test_file_content_with_image_mime_type | TestFileContentType | 139 | null |
gotalab/skillport | import sys
from pathlib import Path
import pytest
from skillport.interfaces.cli.config import (
ProjectConfig,
load_project_config,
)
class TestProjectConfigFromSkillportrc:
def test_empty_instructions_defaults_to_empty_list(self, tmp_path: Path):
"""Empty instructions defaults to empty list."""... | [] | assert | collection | tests/unit/test_project_config.py | test_empty_instructions_defaults_to_empty_list | TestProjectConfigFromSkillportrc | 95 | null |
gotalab/skillport | import json
from skillport.modules.skills import (
check_update_available,
detect_local_modification,
update_skill,
)
from skillport.modules.skills.internal import (
compute_content_hash,
get_missing_skill_ids,
get_tracked_skill_ids,
get_untracked_skill_ids,
record_origin,
scan_inst... | False | assert | bool_literal | tests/unit/test_update.py | test_no_origin_returns_false | TestDetectLocalModification | 30 | null |
gotalab/skillport | from __future__ import annotations
import subprocess
import sys
from pathlib import Path
def _read_toml(path: Path) -> dict:
try:
import tomllib
except ModuleNotFoundError: # Python <3.11
import tomli as tomllib
return tomllib.loads(path.read_text(encoding="utf-8"))
def test_cli_import_... | 0 | assert | numeric_literal | tests/unit/test_dependency_boundaries.py | test_cli_import_does_not_load_index_deps | 35 | null | |
gotalab/skillport | from pathlib import Path
import pytest
from skillport.modules.skills.internal.manager import (
BUILTIN_SKILLS,
_validate_skill_file,
add_builtin,
add_local,
detect_skills,
)
from skillport.shared.config import Config
def _create_skill(path: Path, name: str, description: str = "Test description") ... | 0 | assert | numeric_literal | tests/unit/test_add_logic.py | test_no_skill_md_returns_empty | TestDetectSkills | 56 | null |
gotalab/skillport | import zipfile
import pytest
from skillport.modules.skills.internal.zip_handler import (
MAX_EXTRACTED_BYTES,
MAX_FILE_BYTES,
MAX_ZIP_FILES,
extract_zip,
)
class TestExtractZipSecurity:
def test_rejects_symlink(self, tmp_path):
"""Zip containing symlink is rejected."""
zip_path =... | ValueError, match="Symlink") | pytest.raises | complex_expr | tests/unit/test_zip_handler.py | test_rejects_symlink | TestExtractZipSecurity | 163 | null |
gotalab/skillport | import sys
from pathlib import Path
import pytest
from skillport.interfaces.cli.config import (
ProjectConfig,
load_project_config,
)
class TestProjectConfigFromSkillportrc:
def test_single_instruction_as_string(self, tmp_path: Path):
"""Single instruction can be a string (not list)."""
... | ["AGENTS.md"] | assert | collection | tests/unit/test_project_config.py | test_single_instruction_as_string | TestProjectConfigFromSkillportrc | 48 | null |
gotalab/skillport | from unittest.mock import patch
from skillport.interfaces.mcp.instructions import (
_escape_xml,
build_xml_instructions,
)
from skillport.shared.config import Config
class TestBuildXmlInstructionsWithCoreSkills:
def test_skill_elements_present(self):
"""<skill> elements present for each core skil... | 2 | assert | numeric_literal | tests/unit/test_xml_instructions.py | test_skill_elements_present | TestBuildXmlInstructionsWithCoreSkills | 156 | null |
gotalab/skillport | from skillport.modules.skills.internal import (
compute_content_hash,
get_all_origins,
get_origin,
migrate_origin_v2,
prune_orphan_origins,
record_origin,
update_origin,
)
from skillport.shared.config import Config
class TestMigrateOriginV2:
def test_migrate_adds_new_fields(self):
... | False | assert | bool_literal | tests/unit/test_origin_v2.py | test_migrate_adds_new_fields | TestMigrateOriginV2 | 39 | null |
gotalab/skillport | from pathlib import Path
import pytest
from skillport.shared.config import SKILLPORT_HOME, Config
class TestConfigProviderValidation:
def test_unsupported_provider_rejected(self, monkeypatch):
"""Unsupported embedding provider raises validation error."""
monkeypatch.setenv("SKILLPORT_EMBEDDING_P... | ValueError) | pytest.raises | variable | tests/unit/test_config.py | test_unsupported_provider_rejected | TestConfigProviderValidation | 173 | null |
gotalab/skillport | import base64
from unittest.mock import patch
import pytest
from skillport.interfaces.mcp.instructions import build_xml_instructions
from skillport.interfaces.mcp.server import _get_registered_tools_list
from skillport.modules.skills.public.types import FileContent
from skillport.shared.config import Config
class Te... | "base64" | assert | string_literal | tests/unit/test_transport_mode.py | test_file_content_with_base64_encoding | TestFileContentType | 127 | null |
gotalab/skillport | from unittest.mock import MagicMock, patch
from skillport.modules.indexing.public.query import get_core_skills
from skillport.shared.config import Config
class TestGetCoreSkillsExplicitMode:
def test_explicit_mode_returns_only_specified_skills(self):
"""mode=explicit returns only skills in core_skills li... | "skill-b") | assert_* | string_literal | tests/unit/test_core_skills_mode.py | test_explicit_mode_returns_only_specified_skills | TestGetCoreSkillsExplicitMode | 53 | null |
gotalab/skillport | from pathlib import Path
from unittest.mock import patch
from skillport.modules.indexing.internal.lancedb import IndexStore
from skillport.shared.config import Config
def _make_store(tmp_path: Path):
cfg = Config(skills_dir=tmp_path / "skills", db_path=tmp_path / "db.lancedb")
with patch(
"skillport.m... | True | assert | bool_literal | tests/unit/test_index_state.py | test_state_written_and_skipped_when_unchanged | 39 | null | |
gotalab/skillport | from pathlib import Path
import pytest
from skillport.shared.config import SKILLPORT_HOME, Config
class TestCoreSkillsModeConfig:
def test_core_skills_mode_from_env_explicit(self, monkeypatch):
"""SKILLPORT_CORE_SKILLS_MODE=explicit loaded correctly."""
monkeypatch.setenv("SKILLPORT_CORE_SKILLS_... | "explicit" | assert | string_literal | tests/unit/test_config.py | test_core_skills_mode_from_env_explicit | TestCoreSkillsModeConfig | 223 | null |
gotalab/skillport | import string
from hypothesis import assume, given, settings
from hypothesis import strategies as st
from skillport.modules.skills.internal.validation import (
NAME_MAX_LENGTH,
_validate_name_chars,
validate_skill_record,
)
valid_name_chars = st.sampled_from(string.ascii_lowercase + string.digits + "-")
... | normalized.lower() | assert | func_call | tests/pbt/test_name_properties.py | test_normalization_is_lowercase | TestCategoryNormalizationProperty | 163 | null |
gotalab/skillport | import base64
from unittest.mock import patch
import pytest
from skillport.interfaces.mcp.instructions import build_xml_instructions
from skillport.interfaces.mcp.server import _get_registered_tools_list
from skillport.modules.skills.public.types import FileContent
from skillport.shared.config import Config
class Te... | '{"key": "value"}' | assert | string_literal | tests/unit/test_transport_mode.py | test_json_file_returns_utf8 | TestReadSkillFileBinarySupport | 226 | null |
gotalab/skillport | import zipfile
import pytest
from skillport.modules.skills.internal.zip_handler import (
MAX_EXTRACTED_BYTES,
MAX_FILE_BYTES,
MAX_ZIP_FILES,
extract_zip,
)
class TestExtractZipEdgeCases:
def test_invalid_zip_raises(self, tmp_path):
"""Invalid zip file raises ValueError."""
invali... | ValueError, match="Not a valid zip") | pytest.raises | complex_expr | tests/unit/test_zip_handler.py | test_invalid_zip_raises | TestExtractZipEdgeCases | 256 | null |
gotalab/skillport | import zipfile
import pytest
from skillport.modules.skills.internal.zip_handler import (
MAX_EXTRACTED_BYTES,
MAX_FILE_BYTES,
MAX_ZIP_FILES,
extract_zip,
)
class TestExtractZip:
def test_extract_single_skill_zip(self, tmp_path):
"""Single skill zip is extracted correctly."""
# Cr... | 2 | assert | numeric_literal | tests/unit/test_zip_handler.py | test_extract_single_skill_zip | TestExtractZip | 29 | null |
gotalab/skillport | import string
from hypothesis import assume, given, settings
from hypothesis import strategies as st
from skillport.modules.skills.internal.validation import (
NAME_MAX_LENGTH,
_validate_name_chars,
validate_skill_record,
)
valid_name_chars = st.sampled_from(string.ascii_lowercase + string.digits + "-")
... | 0 | assert | numeric_literal | tests/pbt/test_name_properties.py | test_valid_names_pass_validation | TestNameValidationProperty | 85 | null |
gotalab/skillport | import io
import tarfile
from pathlib import Path
import pytest
from skillport.modules.skills.internal.github import (
GITHUB_URL_RE,
ParsedGitHubURL,
extract_tarball,
parse_github_url,
)
def _make_tar(tmp_path: Path, structure: dict) -> Path:
"""Create a tar.gz with given structure under root fo... | "sha" | assert | string_literal | tests/unit/test_github_source.py | test_extract_tarball_subpath | 317 | null | |
gotalab/skillport | from skillport.modules.skills.internal import (
compute_content_hash,
get_all_origins,
get_origin,
migrate_origin_v2,
prune_orphan_origins,
record_origin,
update_origin,
)
from skillport.shared.config import Config
class TestMigrateOriginV2:
def test_migrate_adds_new_fields(self):
... | "" | assert | string_literal | tests/unit/test_origin_v2.py | test_migrate_adds_new_fields | TestMigrateOriginV2 | 37 | null |
gotalab/skillport | import base64
from unittest.mock import patch
import pytest
from skillport.interfaces.mcp.instructions import build_xml_instructions
from skillport.interfaces.mcp.server import _get_registered_tools_list
from skillport.modules.skills.public.types import FileContent
from skillport.shared.config import Config
class Te... | "text/plain" | assert | string_literal | tests/unit/test_transport_mode.py | test_file_content_mime_type_default_text_plain | TestFileContentType | 116 | null |
gotalab/skillport | import base64
from pathlib import Path
import pytest
from fastmcp.client import Client
from skillport.interfaces.mcp.server import create_mcp_server
from skillport.modules.indexing import build_index
from skillport.shared.config import Config
def _create_test_skill(skills_dir: Path, skill_id: str, content: str = "Te... | "base64" | assert | string_literal | tests/integration/test_mcp_server.py | test_read_skill_file_binary | TestRemoteMode | 157 | null |
gotalab/skillport | import string
from hypothesis import assume, given, settings
from hypothesis import strategies as st
from skillport.modules.skills.internal.validation import (
NAME_MAX_LENGTH,
_validate_name_chars,
validate_skill_record,
)
valid_name_chars = st.sampled_from(string.ascii_lowercase + string.digits + "-")
... | variant2.strip().lower() | assert | func_call | tests/pbt/test_name_properties.py | test_whitespace_variations_normalize_same | TestCategoryNormalizationProperty | 176 | null |
gotalab/skillport | from pathlib import Path
from types import SimpleNamespace
from unittest.mock import patch
import pytest
from skillport.modules.indexing import search as idx_search
from skillport.modules.skills import read_skill_file, search_skills
from skillport.shared.config import Config
def _make_config(tmp_path: Path) -> Confi... | ["alpha", "beta"] | assert | collection | tests/integration/test_search_and_tools_integration.py | test_embedding_failure_falls_back_to_fts | 123 | null | |
gotalab/skillport | import base64
from pathlib import Path
import pytest
from fastmcp.client import Client
from skillport.interfaces.mcp.server import create_mcp_server
from skillport.modules.indexing import build_index
from skillport.shared.config import Config
def _create_test_skill(skills_dir: Path, skill_id: str, content: str = "Te... | "image/png" | assert | string_literal | tests/integration/test_mcp_server.py | test_read_skill_file_binary | TestRemoteMode | 158 | null |
gotalab/skillport | from pathlib import Path
from skillport.interfaces.cli.commands.doc import (
MARKER_END,
MARKER_START,
_truncate_description,
generate_skills_block,
update_agents_md,
)
from skillport.modules.skills import SkillSummary
class TestUpdateAgentsMd:
def test_creates_new_file(self, tmp_path: Path):... | True | assert | bool_literal | tests/unit/test_doc.py | test_creates_new_file | TestUpdateAgentsMd | 276 | null |
gotalab/skillport | from skillport.modules.skills.internal import (
compute_content_hash,
get_all_origins,
get_origin,
migrate_origin_v2,
prune_orphan_origins,
record_origin,
update_origin,
)
from skillport.shared.config import Config
class TestGetAllOrigins:
def test_get_all_origins_empty(self, tmp_path)... | {} | assert | collection | tests/unit/test_origin_v2.py | test_get_all_origins_empty | TestGetAllOrigins | 272 | null |
gotalab/skillport | import json
from pathlib import Path
import pytest
from typer.testing import CliRunner
from skillport.interfaces.cli.app import app
from skillport.shared.utils import parse_frontmatter
runner = CliRunner()
def _create_skill_with_frontmatter(
skills_dir: Path,
name: str,
*,
description: str = "Test s... | 1 | assert | numeric_literal | tests/integration/test_cli_meta_commands.py | test_set_creates_metadata_block | TestMetaSet | 49 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.