#!/usr/bin/python """verifies that the metaclass abc is properly used by ESC/POS :author: `Patrick Kanzler `_ :organization: `python-escpos `_ :copyright: Copyright (c) 2016 Patrick Kanzler :license: MIT """ import pytest import escpos.escpos as escpos from abc import ABCMeta def test_abstract_base_class_raises(): """test whether the abstract base class raises an exception for ESC/POS""" with pytest.raises(TypeError): # This call should raise TypeError because of abstractmethod _raw() escpos.Escpos() def test_abstract_base_class(): """test whether Escpos has the metaclass ABCMeta""" assert issubclass(escpos.Escpos, object) assert type(escpos.Escpos) is ABCMeta