@unittest.skipIf((TEST_ALL != True), 'skipping temporarily')
def test_to_json_xc_recording(self):
    json_str = self.config.to_json()
    expected = '{"Paths": {"my_path": "/foo/bar.txt", "roots": "[/foo/bar.txt, blue.jpg, 10, 3.14]", "toots": "/foo/bar.txt, blue.jpg, 10, 3.14"}, "Training": {"train_str": "resnet18", "train_int": "5", "train_float": "3.14159", "train_yes": "yes", "train_yescap": "Yes", "train_1": "1", "train_on": "On", "train_no": "no", "train_0": "0", "train_off": "off"}, "Parallelism": {}}'
    self.assertEqual(json_str, expected)
    str_stream = io.StringIO()
    full_stream = self.config.to_json(str_stream)
    expected = full_stream.getvalue()
    self.assertEqual(json_str, expected)
    try:
        tmp_file = tempfile.NamedTemporaryFile(dir=self.curr_dir, suffix='.json', delete=False)
        tmp_file.close()
        with open(tmp_file.name, 'w') as fd:
            fd.write('foobar')
        with self.assertRaises(FileExistsError):
            self.config.to_json(tmp_file.name)
    finally:
        tmp_file.close()
        os.remove(tmp_file.name)
    try:
        tmp_file = tempfile.NamedTemporaryFile(dir=self.curr_dir, suffix='.json', delete=False)
        tmp_file.close()
        self.config.to_json(tmp_file.name, check_file_exists=False)
    finally:
        tmp_file.close()
        os.remove(tmp_file.name)
@unittest.skipIf((TEST_ALL != True), 'skipping temporarily')
def test_to_json_xc_recording(self):
    json_str = self.config.to_json()
    expected = '{"Paths": {"my_path": "/foo/bar.txt", "roots": "[/foo/bar.txt, blue.jpg, 10, 3.14]", "toots": "/foo/bar.txt, blue.jpg, 10, 3.14"}, "Training": {"train_str": "resnet18", "train_int": "5", "train_float": "3.14159", "train_yes": "yes", "train_yescap": "Yes", "train_1": "1", "train_on": "On", "train_no": "no", "train_0": "0", "train_off": "off"}, "Parallelism": {}}'
    self.assertEqual(json_str, expected)
    str_stream = io.StringIO()
    full_stream = self.config.to_json(str_stream)
    expected = full_stream.getvalue()
    self.assertEqual(json_str, expected)
    try:
        tmp_file = tempfile.NamedTemporaryFile(dir=self.curr_dir, suffix='.json', delete=False)
        tmp_file.close()
        with open(tmp_file.name, 'w') as fd:
            fd.write('foobar')
        with self.assertRaises(FileExistsError):
            self.config.to_json(tmp_file.name)
    finally:
        tmp_file.close()
        os.remove(tmp_file.name)
    try:
        tmp_file = tempfile.NamedTemporaryFile(dir=self.curr_dir, suffix='.json', delete=False)
        tmp_file.close()
        self.config.to_json(tmp_file.name, check_file_exists=False)
    finally:
        tmp_file.close()
        os.remove(tmp_file.name)