Ran flake8 and black against tests.

This commit is contained in:
Mark Wolfman
2021-04-16 11:28:05 -05:00
parent 0c3dbc73fc
commit e5ec51b0e7
11 changed files with 278 additions and 207 deletions
+11 -6
View File
@@ -8,21 +8,26 @@ from dungeonsheets.features import create_feature, Feature, all_features
class TestFeatures(TestCase):
"""Tests for features and feature-related activities."""
def test_all_features(self):
# Make sure only features are returned
for ThisFeature in all_features():
self.assertTrue(isinstance(ThisFeature, type),
f"``all_features`` returned {ThisFeature} (not a class)")
self.assertTrue(issubclass(ThisFeature, Feature),
f"``all_features`` returned {ThisFeature} (not a feature)")
self.assertTrue(
isinstance(ThisFeature, type),
f"``all_features`` returned {ThisFeature} (not a class)",
)
self.assertTrue(
issubclass(ThisFeature, Feature),
f"``all_features`` returned {ThisFeature} (not a feature)",
)
# Pick a couple of known features to spot-check for
all_the_features = list(all_features())
self.assertIn(features.FalseIdentity, all_the_features)
self.assertIn(features.DivineSmite, all_the_features)
def test_create_feature(self):
NewFeature = create_feature(name="Hello world")
self.assertTrue(issubclass(NewFeature, Feature))
self.assertEqual(NewFeature.name, 'Hello world')
self.assertEqual(NewFeature.name, "Hello world")
feature = NewFeature()
print(feature, feature.__class__, type(feature))