Пример #1
0
def setup():
    """Initialize a basic game structure with
    the local levels installed"""

    levels = Loader.local_levels()
    story = Story()

    for level in levels:
        story.add_level(level)

    add_url(
        "actions/<level_identifier>/<action_identifier>",
        generate_resolve_action_view(story),
    )
Пример #2
0
 def test_local_levels_is_checking_current_class_inheritance(self):
     with self.assertRaises(InvalidCurrentClass):
         list(Loader.local_levels())
Пример #3
0
 def test_local_levels_is_checking_missing_current_class(self):
     with self.assertRaises(MissingCurrentClass):
         list(Loader.local_levels())
Пример #4
0
 def test_local_levels_is_checking_duplicated_ids(self):
     with self.assertRaises(DuplicatedLevelIdentifier):
         list(Loader.local_levels())
Пример #5
0
 def test_local_levels_is_checking_manifest(self):
     with self.assertRaises(InvalidManifestStructure):
         list(Loader.local_levels())
Пример #6
0
 def test_local_levels_missing_required_files(self):
     with self.assertRaises(InvalidLevelStructure):
         list(Loader.local_levels())
Пример #7
0
 def test_local_levels_ok(self):
     local_levels = list(Loader.local_levels())
     self.assertEqual(len(local_levels), 1)