コード例 #1
0
def test_recovered_keys(session, recovery):
    """Testing that after recovery operation keys, which had to be recovered,
    are recovered and have correct data."""
    for key in recovery["keys"]["recovered"]:
        for group in session.groups:
            result = session.read_data_from_groups(key, [group]).get()[0]
            assert_that(key, equal_to(get_sha1(result.data)),
                        "The recovered data mismatch by sha1 hash")
コード例 #2
0
def test_consistent_keys(session, recovery):
    """Testing that after recovery operation keys, which were availabe in all groups,
    are still available in all groups and have correct data."""
    for key in recovery["keys"]["consistent"]:
        for group in session.groups:
            result = session.read_data_from_groups(key, [group]).get()[0]
            assert_that(key, equal_to(get_sha1(result.data)),
                        "After recovering the data mismatch by sha1 hash")
コード例 #3
0
def test_inconsistent_keys(session, recovery, dropped_groups):
    """Testing that after recovery operation keys, which were available in some specific groups,
    are still available in these groups and have correct data."""
    available_groups = [group for group in session.groups
                        if group not in dropped_groups]
    for key in recovery["keys"]["inconsistent"]:
        for group in available_groups:
            result = session.read_data_from_groups(key, [group]).get()[0]
            assert_that(key, equal_to(get_sha1(result.data)),
                        "After recovering the data mismatch by sha1 hash")
コード例 #4
0
ファイル: matchers.py プロジェクト: uvizhe/elliptics-tests
 def __init__(self, data):
     self.expected_sha1 = get_sha1(data)
コード例 #5
0
ファイル: matchers.py プロジェクト: uvizhe/elliptics-tests
 def describe_mismatch(self, item, mismatch_description):
     mismatch_description.append_text(get_sha1(str(item)))
コード例 #6
0
ファイル: matchers.py プロジェクト: uvizhe/elliptics-tests
 def _matches(self, item):
     result_sha1 = get_sha1(str(item))
     return result_sha1 == self.expected_sha1