File: test_plugin.py

package info (click to toggle)
segno 1.6.6-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,072 kB
  • sloc: python: 9,936; makefile: 162; javascript: 16
file content (30 lines) | stat: -rw-r--r-- 572 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#
# Copyright (c) 2016 - 2024 -- Lars Heuer
# All rights reserved.
#
# License: BSD License
#
"""\
Tests plugin loading.
"""
import pytest
import segno


def test_noplugin():
    qr = segno.make('The Beatles')
    with pytest.raises(AttributeError):
        qr.to_unknown_plugin()


def test_plugin():
    try:
        import qrcode_artistic
        qr = segno.make('The Beatles')
        assert qr.to_pil() is not None
    except:
        print("The module qrcode_artistic is not installed; the test is skipped.")


if __name__ == '__main__':
    pytest.main([__file__])