def test_add_tree(self): """Test Shard.add_tree().""" shard = Shard() shard.add_tree('node') assert shard.tree == ['node']
def test_add_challenge(self): """Test Shard.add_challenge().""" shard = Shard() shard.add_challenge('challenge1') assert shard.challenges == ['challenge1']
def _assert_init(self, kwargs): """Run __init__ assertions. Args: kwargs (dict): keyword arguments for the Shard initializer. Raises: AssertionError: Shard attributes is not set as expected. """ shard = Shard(**kwargs) if 'challenges' in kwargs: assert kwargs['challenges'] else: assert shard.challenges == [] if 'exclude' in kwargs: assert kwargs['exclude'] else: assert shard.exclude == [] assert shard.hash == kwargs['hash'] assert shard.id == kwargs['id'] assert shard.index == kwargs['index'] assert shard.size is None assert kwargs['tree'] if 'tree' in kwargs else [] == shard.tree