Example #1
0
    def test_matching_files_returns_zipcodes_and_filenames(self):
        self.make_empty_file('20001.json')
        self.make_empty_file('20002.json')
        self.make_empty_file('something.json')

        self.assertEqual(
            sorted(list(get_counselor_json_files(self.tempdir))),
            sorted([
                ('20001', os.path.join(self.tempdir, '20001.json')),
                ('20002', os.path.join(self.tempdir, '20002.json')),
            ]))
Example #2
0
    def test_matching_files_returns_zipcodes_and_filenames(self):
        self.make_empty_file('20001.json')
        self.make_empty_file('20002.json')
        self.make_empty_file('something.json')

        self.assertEqual(
            sorted(list(get_counselor_json_files(self.tempdir))),
            sorted([
                ('20001', os.path.join(self.tempdir, '20001.json')),
                ('20002', os.path.join(self.tempdir, '20002.json')),
            ])
        )
 def test_no_matching_files_raises_runtime_error(self):
     self.make_empty_file('something.json')
     with self.assertRaises(RuntimeError):
         list(get_counselor_json_files(self.tempdir))
 def test_no_files_raises_runtime_error(self):
     with self.assertRaises(RuntimeError):
         list(get_counselor_json_files(self.tempdir))
Example #5
0
 def test_no_matching_files_raises_runtime_error(self):
     self.make_empty_file('something.json')
     with self.assertRaises(RuntimeError):
         list(get_counselor_json_files(self.tempdir))
Example #6
0
 def test_no_files_raises_runtime_error(self):
     with self.assertRaises(RuntimeError):
         list(get_counselor_json_files(self.tempdir))