def test_loads_rule_bank_from_rulebank_path(tempdir, installed_ruleset):
    loaded = rule_bank.load_rule_bank(directory=tempdir.name, encryption_key='test-key')

    strategy = loaded.get_strategy(installed_ruleset)
    assert type(strategy) == rule_bank.RuleSet
    result = strategy.generate_password(['a', 'b', 'c'])
    assert result == 'abc'
예제 #2
0
def test_loads_rule_bank_from_rulebank_path(tempdir, installed_ruleset):
    loaded = rule_bank.load_rule_bank(directory=tempdir.name,
                                      encryption_key='test-key')

    strategy = loaded.get_strategy(installed_ruleset)
    assert type(strategy) == rule_bank.RuleSet
    result = strategy.generate_password(['a', 'b', 'c'])
    assert result == 'abc'
예제 #3
0
def test_compiled_ruleset_can_be_read_by_parser(
        ruleset_name: str, tempdir: tempfile.TemporaryDirectory):
    path_to_ruleset = rulset_path(ruleset_name)
    assert path.isdir(path_to_ruleset)
    compile_ruleset(path_to_ruleset,
                    output_path=tempdir.name,
                    ruleset_encryption_password='******')
    rule_bank = load_rule_bank(directory=tempdir.name,
                               encryption_key='encryption-key')
    assert rule_bank.get_strategy(ruleset_name) is not None
def test_compiled_ruleset_can_be_read_by_parser(ruleset_name: str, tempdir: tempfile.TemporaryDirectory):
    path_to_ruleset = rulset_path(ruleset_name)
    assert path.isdir(path_to_ruleset)
    compile_ruleset(path_to_ruleset, output_path=tempdir.name, ruleset_encryption_password='******')
    rule_bank = load_rule_bank(directory=tempdir.name, encryption_key='encryption-key')
    assert rule_bank.get_strategy(ruleset_name) is not None