Пример #1
0
 def test_register_backend(self):
     shaape = Shaape(TestUtils.EMPTY_INPUT)
     original_backends = copy.copy(shaape.backends())
     cairobackend = CairoBackend()
     shaape.register_backend(cairobackend)
     assert shaape.backends() == original_backends + [cairobackend]
     assert_raises(TypeError, shaape.register_backend, OverlayParser())
Пример #2
0
 def test_register_backend(self):
     shaape = Shaape(TestUtils.EMPTY_INPUT)
     original_backends = copy.copy(shaape.backends())
     cairobackend = CairoBackend()
     shaape.register_backend(cairobackend)
     assert shaape.backends() == original_backends + [cairobackend]
     assert_raises(TypeError, shaape.register_backend, OverlayParser())
Пример #3
0
 def test_run(self):
     shaape = Shaape(TestUtils.EMPTY_INPUT)
     for parser in shaape.parsers():
         parser.run = MagicMock()
     for backend in shaape.backends():
         backend.run = MagicMock()
     shaape.run()
     for parser in shaape.parsers():
         parser.run.assert_called_once()
     for backend in shaape.backends():
         backend.run.assert_called_once()
Пример #4
0
 def test_run(self):
     shaape = Shaape(TestUtils.EMPTY_INPUT)
     for parser in shaape.parsers():
         parser.run = MagicMock()
     for backend in shaape.backends():
         backend.run = MagicMock()
     shaape.run()
     for parser in shaape.parsers():
         parser.run.assert_called_once()
     for backend in shaape.backends():
         backend.run.assert_called_once()