Exemplo n.º 1
0
 def test_load_template_json(self):
     init_loader.load_init_data("../database/init.json")
     loader = item_loader.ItemLoader()
     data = json.loads(loader.load_template_json("not a type name"))
     self.assertEqual(data["title"], "New Item")
     data = json.loads(loader.load_template_json("item"))
     self.assertEqual(data["title"], "New Item")
Exemplo n.º 2
0
 def test_load_template_json(self):
     init_loader.load_init_data("../database/init.json")
     loader = item_loader.ItemLoader()
     data = json.loads(loader.load_template_json("not a type name"))
     self.assertEqual(data["title"], "New Item")
     data = json.loads(loader.load_template_json("item"))
     self.assertEqual(data["title"], "New Item")
Exemplo n.º 3
0
 def test_load_item_type(self):
     init_loader.load_init_data("../database/init.json")
     loader = item_loader.ItemLoader()
     type_item = loader.load_type("item")
     self.assertEqual("/system/types/item", type_item.handle.path)
     self.assertIsNotNone(type_item)
     self.assertEqual(str(type_item.handle.item_id), type_item.type_path)
     # Some intermediate ids are cached in loader, so do this twice
     type_item = loader.load_type("item")
     self.assertIsNotNone(type_item)
     self.assertEqual(str(type_item.handle.item_id), type_item.type_path)
     self.assertEqual("/system/types/item", type_item.handle.path)
Exemplo n.º 4
0
 def test_load_item_type(self):
     init_loader.load_init_data("../database/init.json")
     loader = item_loader.ItemLoader()
     type_item = loader.load_type("item")
     self.assertEqual("/system/types/item", type_item.handle.path)
     self.assertIsNotNone(type_item)
     self.assertEqual(str(type_item.handle.item_id), type_item.type_path)
     # Some intermediate ids are cached in loader, so do this twice
     type_item = loader.load_type("item")
     self.assertIsNotNone(type_item)
     self.assertEqual(str(type_item.handle.item_id), type_item.type_path)
     self.assertEqual("/system/types/item", type_item.handle.path)
Exemplo n.º 5
0
 def setUp(self):
     dbgw.reset()
     init_loader.load_init_data("../database/init.json")
Exemplo n.º 6
0
 def load_init_data(self):
     init_data_path = "database/init.json"
     load_init_data(init_data_path)
Exemplo n.º 7
0
 def setUpClass(cls):
     dbgw.reset()
     init_loader.load_init_data("../database/init.json")
Exemplo n.º 8
0
 def setUp(self):
     dbgw.reset()
     init_loader.load_init_data("../database/init.json")
Exemplo n.º 9
0
 def test_load_init_data(self):
     init_loader.load_init_data("../database/init.json")
     pass
Exemplo n.º 10
0
 def setUp(cls):
     dbgw.reset()
     init_loader.load_init_data("../database/init.json")
     init_loader.load_init_data("data/user_item_tests.json")
Exemplo n.º 11
0
 def setUpClass(cls):
     dbgw.reset()
     init_loader.load_init_data("../database/init.json")
Exemplo n.º 12
0
 def setUp(self):
     dbgw.reset()
     init_loader.load_init_data("../database/init.json")
     init_loader.load_init_data("data/saver_tests.json")
Exemplo n.º 13
0
 def test_load_init_data(self):
     init_loader.load_init_data("../database/init.json")
     pass