2 # Copyright 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 from json_comment_eater
import Nom
9 class JsonCommentEaterTest(unittest
.TestCase
):
10 def _Load(self
, test_name
):
11 '''Loads the input and expected output for |test_name| as given by reading
12 in |test_name|.json and |test_name|_expected.json, and returns the string
13 contents as a tuple in that order.
16 with
open(file_name
, 'r') as f
:
18 return [read(pattern
% test_name
)
19 for pattern
in ('%s.json', '%s_expected.json')]
21 def testEverything(self
):
22 json
, expected_json
= self
._Load
('everything')
23 self
.assertEqual(expected_json
, Nom(json
))
25 if __name__
== '__main__':