Exemplo n.º 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),
    )
Exemplo n.º 2
0
 def test_local_levels_is_checking_current_class_inheritance(self):
     with self.assertRaises(InvalidCurrentClass):
         list(Loader.local_levels())
Exemplo n.º 3
0
 def test_local_levels_is_checking_missing_current_class(self):
     with self.assertRaises(MissingCurrentClass):
         list(Loader.local_levels())
Exemplo n.º 4
0
 def test_local_levels_is_checking_duplicated_ids(self):
     with self.assertRaises(DuplicatedLevelIdentifier):
         list(Loader.local_levels())
Exemplo n.º 5
0
 def test_local_levels_is_checking_manifest(self):
     with self.assertRaises(InvalidManifestStructure):
         list(Loader.local_levels())
Exemplo n.º 6
0
 def test_local_levels_missing_required_files(self):
     with self.assertRaises(InvalidLevelStructure):
         list(Loader.local_levels())
Exemplo n.º 7
0
 def test_local_levels_ok(self):
     local_levels = list(Loader.local_levels())
     self.assertEqual(len(local_levels), 1)