Example #1
0
 def test_upgrade_one_version(self):
     for p in glob.iglob(
             os.path.join(os.path.dirname(__file__), "json_config/*.json")):
         with open(p) as f:
             test_data = json.load(f)
             for test_case in test_data:
                 old_config = test_case["original"]
                 new_config = upgrade_one_version(old_config)
                 self.assertEqual(new_config, test_case["adapted"])
 def test_upgrade_one_version(self):
     # Always show the full diff, easier to debug when getting a failed log
     self.maxDiff = None
     for p in glob.iglob(
             os.path.join(os.path.dirname(__file__), "json_config/*.json")):
         print("Trying to upgrade file:" + p)
         with PathManager.open(p) as f:
             test_data = json.load(f)
             for test_case in test_data:
                 old_config = test_case["original"]
                 new_config = upgrade_one_version(old_config)
                 self.assertEqual(new_config, test_case["adapted"])