コード例 #1
0
def test_task_hashes():
    essential_fields = ['content', 'tags']
    t1 = task(content='A')
    t2 = task(content='B', tags=None)
    t3 = task(content='B', tags=[])
    assert get_hash(t1, essential_fields) != get_hash(t2, essential_fields)
    assert get_hash(t2, essential_fields) == get_hash(t3, essential_fields)
コード例 #2
0
def test_get_hash_essential_fields():
    id2 = task(content='foo', indent=2)
    id3 = task(content='foo', indent=3)
    assert get_hash(id2, essential_fields=['content']) == get_hash(
        id3, essential_fields=['content'])
    assert get_hash(id2, essential_fields=['content', 'indent']) != get_hash(
        id3, essential_fields=['content', 'indent'])
コード例 #3
0
ファイル: test_sync_bridge.py プロジェクト: Doist/powerapp
def test_task_hashes():
    essential_fields = ['content', 'tags']
    t1 = task(content='A')
    t2 = task(content='B', tags=None)
    t3 = task(content='B', tags=[])
    assert get_hash(t1, essential_fields) != get_hash(t2, essential_fields)
    assert get_hash(t2, essential_fields) == get_hash(t3, essential_fields)
コード例 #4
0
def test_bridge_passes_tasks_through(td, gh, bridge):
    # add a task to the adapter
    foo = task(content='foo')
    bridge.push_task(td, 1, foo)

    # check how id mapping works
    mapping = ItemMapping.objects.bridge_get(bridge, left_id=1)
    assert mapping.left_hash == get_hash(foo, essential_fields=TASK_FIELDS)
    assert mapping.left_id == '1'
    assert gh.storage[mapping.right_id] == foo
コード例 #5
0
ファイル: test_sync_bridge.py プロジェクト: Doist/powerapp
def test_bridge_passes_tasks_through(td, gh, bridge):
    # add a task to the adapter
    foo = task(content='foo')
    bridge.push_task(td, 1, foo)

    # check how id mapping works
    mapping = ItemMapping.objects.bridge_get(bridge, left_id=1)
    assert mapping.left_hash == get_hash(foo, essential_fields=TASK_FIELDS)
    assert mapping.left_id == '1'
    assert gh.storage[mapping.right_id] == foo
コード例 #6
0
ファイル: test_sync_bridge.py プロジェクト: Doist/powerapp
def test_get_hash_essential_fields():
    id2 = task(content='foo', indent=2)
    id3 = task(content='foo', indent=3)
    assert get_hash(id2, essential_fields=['content']) == get_hash(id3, essential_fields=['content'])
    assert get_hash(id2, essential_fields=['content', 'indent']) != get_hash(id3, essential_fields=['content', 'indent'])