示例#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")
 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")
示例#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)
 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)
示例#5
0
 def setUp(self):
     dbgw.reset()
     init_loader.load_init_data("../database/init.json")
示例#6
0
 def load_init_data(self):
     init_data_path = "database/init.json"
     load_init_data(init_data_path)
示例#7
0
 def setUpClass(cls):
     dbgw.reset()
     init_loader.load_init_data("../database/init.json")
 def setUp(self):
     dbgw.reset()
     init_loader.load_init_data("../database/init.json")
 def test_load_init_data(self):
     init_loader.load_init_data("../database/init.json")
     pass
示例#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")
示例#11
0
 def setUpClass(cls):
     dbgw.reset()
     init_loader.load_init_data("../database/init.json")
示例#12
0
 def setUp(self):
     dbgw.reset()
     init_loader.load_init_data("../database/init.json")
     init_loader.load_init_data("data/saver_tests.json")
示例#13
0
 def test_load_init_data(self):
     init_loader.load_init_data("../database/init.json")
     pass