Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_slugify():
assert slugify("Example Beancount File") == "example-beancount-file"
assert slugify(" Example Beancount File ") == "example-beancount-file"
assert slugify("test") == "test"
assert slugify("烫烫烫") == "烫烫烫"
assert slugify("nonun烫icode 烫烫") == "nonun烫icode-烫烫"
assert slugify("%✓") == ""
assert slugify("söße") == "söße"
assert slugify("ASDF") == "asdf"
assert slugify("ASDF test test") == "asdf-test-test"
def test_slugify():
assert slugify("Example Beancount File") == "example-beancount-file"
assert slugify(" Example Beancount File ") == "example-beancount-file"
assert slugify("test") == "test"
assert slugify("烫烫烫") == "烫烫烫"
assert slugify("nonun烫icode 烫烫") == "nonun烫icode-烫烫"
assert slugify("%✓") == ""
assert slugify("söße") == "söße"
assert slugify("ASDF") == "asdf"
assert slugify("ASDF test test") == "asdf-test-test"
def test_slugify():
assert slugify("Example Beancount File") == "example-beancount-file"
assert slugify(" Example Beancount File ") == "example-beancount-file"
assert slugify("test") == "test"
assert slugify("烫烫烫") == "烫烫烫"
assert slugify("nonun烫icode 烫烫") == "nonun烫icode-烫烫"
assert slugify("%✓") == ""
assert slugify("söße") == "söße"
assert slugify("ASDF") == "asdf"
assert slugify("ASDF test test") == "asdf-test-test"
def test_slugify():
assert slugify("Example Beancount File") == "example-beancount-file"
assert slugify(" Example Beancount File ") == "example-beancount-file"
assert slugify("test") == "test"
assert slugify("烫烫烫") == "烫烫烫"
assert slugify("nonun烫icode 烫烫") == "nonun烫icode-烫烫"
assert slugify("%✓") == ""
assert slugify("söße") == "söße"
assert slugify("ASDF") == "asdf"
assert slugify("ASDF test test") == "asdf-test-test"
def test_slugify():
assert slugify("Example Beancount File") == "example-beancount-file"
assert slugify(" Example Beancount File ") == "example-beancount-file"
assert slugify("test") == "test"
assert slugify("烫烫烫") == "烫烫烫"
assert slugify("nonun烫icode 烫烫") == "nonun烫icode-烫烫"
assert slugify("%✓") == ""
assert slugify("söße") == "söße"
assert slugify("ASDF") == "asdf"
assert slugify("ASDF test test") == "asdf-test-test"
def test_slugify():
assert slugify("Example Beancount File") == "example-beancount-file"
assert slugify(" Example Beancount File ") == "example-beancount-file"
assert slugify("test") == "test"
assert slugify("烫烫烫") == "烫烫烫"
assert slugify("nonun烫icode 烫烫") == "nonun烫icode-烫烫"
assert slugify("%✓") == ""
assert slugify("söße") == "söße"
assert slugify("ASDF") == "asdf"
assert slugify("ASDF test test") == "asdf-test-test"
def test_slugify():
assert slugify("Example Beancount File") == "example-beancount-file"
assert slugify(" Example Beancount File ") == "example-beancount-file"
assert slugify("test") == "test"
assert slugify("烫烫烫") == "烫烫烫"
assert slugify("nonun烫icode 烫烫") == "nonun烫icode-烫烫"
assert slugify("%✓") == ""
assert slugify("söße") == "söße"
assert slugify("ASDF") == "asdf"
assert slugify("ASDF test test") == "asdf-test-test"
def _load_file():
"""Load Beancount files.
This is run automatically on the first request.
"""
app.config["LEDGERS"] = {}
for filepath in app.config["BEANCOUNT_FILES"]:
ledger = FavaLedger(filepath)
slug = slugify(ledger.options["title"])
if not slug:
slug = slugify(filepath)
app.config["LEDGERS"][slug] = ledger
app.config["FILE_SLUGS"] = list(app.config["LEDGERS"].keys())
def _load_file():
"""Load Beancount files.
This is run automatically on the first request.
"""
app.config["LEDGERS"] = {}
for filepath in app.config["BEANCOUNT_FILES"]:
ledger = FavaLedger(filepath)
slug = slugify(ledger.options["title"])
if not slug:
slug = slugify(filepath)
app.config["LEDGERS"][slug] = ledger
app.config["FILE_SLUGS"] = list(app.config["LEDGERS"].keys())