Esempio n. 1
0
def test_json():
    mm = makemap(auto.index(tdata('auto/pocket.json')))
    assert mm.keys() == _JSON_URLS

    # TODO not sure if they deserve separate visits..
    [v1, v2] = mm[sa2464]
    assert v1.context == 'list::yyy::given_url'
    assert v1.locator.href.startswith('editor://')
    assert v1.locator.href.endswith('pocket.json')
Esempio n. 2
0
def test_auto() -> None:
    mm = makemap(auto.index(tdata('auto')))
    org_link = 'https://www.youtube.com/watch?v=rHIkrotSwcc'
    assert {
        *_JSON_URLS,
        org_link,
    }.issubset(mm.keys())

    [v] = mm[org_link]
    assert v.locator.title == 'orgs' + os.sep + 'file.org:14'  # meh
    assert v.locator.href.endswith('file.org:14')
    assert "xxx /r/cpp" in v.context
    assert "I've enjoyed [Chandler Carruth's" in v.context
Esempio n. 3
0
def test_json() -> None:
    mm = makemap(auto.index(
        tdata('auto'),
        ignored='*/orgs/*',
    ))
    assert mm.keys() == _JSON_URLS

    # TODO not sure if they deserve separate visits..
    [v1, v2] = mm[sa2464]
    assert v1.context == 'list::yyy::given_url'
    # todo not sure if editor:// work on Windows
    assert v1.locator.href.startswith('editor://')
    assert v1.locator.href.endswith('pocket.json')
Esempio n. 4
0
def test_auto():
    mm = makemap(auto.index(tdata('auto')))
    org_link = 'https://www.youtube.com/watch?v=rHIkrotSwcc'
    assert {
        *_JSON_URLS,
        org_link,
    }.issubset(mm.keys())

    [v] = mm[org_link]
    assert v.locator.title == 'orgs/file.org'
    assert v.locator.href.endswith(
        'file.org')  # TODO link number or jump to heading?
    assert "xxx /r/cpp" in v.context
    assert "I've enjoyed [Chandler Carruth's" in v.context
Esempio n. 5
0
def test_logseq() -> None:
    mm = makemap(auto.index(tdata('logseq-graph')))
    example_url = 'https://example.com'
    [v] = mm[example_url]
    assert v.locator.href.startswith('logseq://')
Esempio n. 6
0
def test_obsidian() -> None:
    mm = makemap(auto.index(tdata('obsidian-vault')))
    example_url = 'https://example.com'
    [v] = mm[example_url]
    assert v.locator.href.startswith('obsidian://')