def test_logs_on_missing_file(self):
workdir = self.useFixture(fixtures.TempDir())
fake_logger = self.useFixture(fixtures.FakeLogger())
bad_path = os.path.join(workdir.path, 'path_does_not_exist')
result = _build_doubles.extract_schemas_from_file(bad_path)
self.assertIsNone(result)
self.assertThat(
fake_logger.output,
Contains('Extracting schemas from %s' % bad_path))
self.assertThat(
fake_logger.output,
Contains('Cannot extract schemas: No such file or directory'))
评论列表
文章目录