Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/pathsim_flight/icons/CAStoEAS.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/pathsim_flight/icons/CAStoMach.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/pathsim_flight/icons/CAStoTAS.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/pathsim_flight/icons/EAStoTAS.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/pathsim_flight/icons/ISAtmosphere.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/pathsim_flight/icons/JSBSimWrapper.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/pathsim_flight/icons/MachtoCAS.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/pathsim_flight/icons/TAStoCAS.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions tests/test_icons.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import unittest
import xml.etree.ElementTree as ET

from pathsim.blocks import Block

import pathsim_flight


class TestIcons(unittest.TestCase):
"""Every block of the toolbox has an icon, read by Block.icon()."""

def test_blocks_have_icons(self):
blocks = [
obj
for obj in vars(pathsim_flight).values()
if isinstance(obj, type)
and issubclass(obj, Block)
and obj.__module__.startswith("pathsim_flight")
]
self.assertGreater(len(blocks), 0)

for cls in blocks:
with self.subTest(block=cls.__name__):
icon = cls.icon()
self.assertIsNotNone(icon)
root = ET.fromstring(icon)
self.assertEqual(root.get("viewBox"), "0 0 96 64")


if __name__ == "__main__":
unittest.main()
Loading